I was wondering bootstrap validations can be implemented in Angular 2 multi-select dropdown by cuppa labs. I went through the documentation but was unable to find any.
Basically I want to highlight the dropdown in red if user does not select any values like for a normal input I can use [ngClass]="{'is-invalid': someThing.invalid}"
. Here is my HTML and what I have tried:
<angular2-multiselect name="countries"
[(ngModel)]="myModel.countries" #countries2="ngModel"
presentInCountries [data]="countries"
[settings]="presentInCountriesdropdownSettings"
(ngModelChange)="multiselectChangeCountries($event)">
</angular2-multiselect>
I tried setting a boolean to true if selected countries is 0 and then apply:
this.presentInCountriesdropdownSettings.classes += ' is-invalid';
But this does not work. Is there any way to implement this?