Search code examples
angularangular-ngselect

ng-select Angular 2+ change model view


I'm using the ng-select component for my angular 5 app. ng-select component I want to change the view component. In multiple select, I want to print the number of components rather than listing the ones selected.


Solution

  • From the examples :

    <ng-select
            [items]="people$1 | async"
            [multiple]="true"
            [closeOnSelect]="false"
            bindLabel="name"
            placeholder="Select people"
            [(ngModel)]="selectedPeople1">
    </ng-select>
    
    <p>Number of selected persons : {{selectedPeople1.length}}</p>