1

I'm trying to add the type-ahead http example to my project (ng-bootstrap). I have simply copied over the typeahead-http html and typescript file. I then changed my app.module.ts to include the type ahead files :

import { WikipediaService } from './components/TypeAhead/typeahead-http'; import { NgbdTypeaheadHttp } from './components/TypeAhead/typeahead-http'; 

I've added NgbdTypeaheadHttp to the list of declarations and WikipediaService to the providers but i keep getting the following error :

Exception: Call to Node module failed with error: Error: Template parse errors: Can't bind to 'ngModel' since it isn't a known property of 'input'. ("div class="form-group" [class.has-danger]="searchFailed"> ][(ngModel)]="model" [ngbTypeahead]="search" placeholder="Wikipedia search" />

Things i've checked/tried

  • Bootstrap css has been added
  • My app.module has import { NgModule } from '@angular/core';
  • I've tried adding FormControl, etc from @angular/forms

1 Answer 1

3

Have you imported forms module in your app.module and declared it in imports array?

Sign up to request clarification or add additional context in comments.

1 Comment

I was adding the ReactiveFormsModule instead of the FormsModule

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.