Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda