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

273
Vistas
Facing issue in adding style to ng-container for only inside a div

I am trying to mimic the behavior of mat-form-field for required validation on ng-select In order to mimic the behaviour I need to add border and color as red when mat-error trigeered.

Here is my HTML

 <form (fromgroup)="form">
  <div id="div1">
    <ng-select
    formcontrolName="gender"
    [(ng-model)]=names
    required
    >
    <ng-template let-items="$items">
    <input
     type=checkbox
    select All
    />
    </ng-template>
    </ng-select>
    <mat-error class="ng-select-error ng-select-required" 
    *ngif="!form.controls["gender"].valid&& form.controls["gender"].touched"
    >
    
    </mat-error>
   </div>
 </form>

What Ia m trying to do is when he user touches the ng-select and did not select any item for checkbox,we should highlight the ng-select drodown with red color

I tried with the css but it snot highlighting the ng-select

scss:

.ng-select-required{
    #div1 .ng-select-container {border-bottom: solid 1px red }
    #div1 .ng-placeholder {color:red}
    #div1 .ng-arrow {color:red}
    }
 .ng-select-error{
font-size:12px

}

I am trying to do the with the above css but it is not highlighting the ng-container and ng-select . Please let me know why css is not working or anything I am doing wrong

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