Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

278
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda