There is no provider for NgModel! (Typeahead & # 8594; NgModel) when adding ngControl to bootstrap 4 TypeHead angular 2

I am trying to add ngControl form validation in bootstrap 4 controlhead headhead in Angualr js 2. The code is as follows.

<input [(ngModel)]="model.brand" [typeahead]="model.brands" ng-model-options="{'updateOn': 'blur'}" (typeaheadOnSelect)="brandOnSelect($event)" (typeaheadNoResults)="brandNoResults($event)" [typeaheadOptionField]="'Value'" class="form-control" ngcontrol="brand" > <div *ngIf="brand.dirty && !brand.valid "> <p *ngIf="brand.errors.required" class="text-help">{{ required }}</p> </div> 
+7
angular twitter-bootstrap-4 bootstrap-4
source share
1 answer

You missed the "name" attribute on the input, which is necessary for ngModel to work properly.

+1
source share

All Articles