Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
Override Shared Component CSS for span elements

I am trying to override the CSS of a shared component. I need to replace the CSS for hasData and containers. I tried to use ng:deep but it still doesn't seem to override it. I want to change the class to hasData badge badge.. instead of badge badge.. on the span element. However I still want to keep the badge properties and add some additional styles to it. What am I doing wrong?

<shared-component
  [className]="test.hasDataId ? 'hasData' : 'containers'"
  *ngIf="dataItem.test"
  [hasData]="dataItem.test.hasDataId"
  [containers]="dataItem.test.parentTest"
  (testClick)="test($event)"
>

The output I am getting:

<shared-component 
  _nghost-iny-c569="" 
  class="hasdata" 
  ng-reflect-has-contents="true" 
  ng-reflect-containers=""
>
  <span 
  _ngcontent-iny-c569="" 
  kendotooltip="" 
  class="badge badge-primary mr-2 ng-star-inserted" 
  title="" 
  data-title="testtest"
  >
    Has Data
  </span>
</shared-component>

my CSS:

:host ::ng-deep .hasData  {
  cursor: pointer;
  width: 90%;
  font-size: 80%;
  background-color: grey;
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!