Uncaught Error: Unexpected directive 'NgbTypeahead' imported by the module 'AppModule'. Please add a @NgModule annotation.
See original GitHub issueBug description:
Followed the instructions on https://ng-bootstrap.github.io/#/getting-started
Installed ng-bootstrap:
npm install --save @ng-bootstrap/ng-bootstrap
Imported:
import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap';
Declared:
@NgModule({ declarations: [AppComponent], imports: [NgbTypeahead], providers: [], bootstrap: [AppComponent] }) export class AppModule { }
When running the app I get an error: Uncaught Error: Unexpected directive ‘NgbTypeahead’ imported by the module ‘AppModule’. Please add a @NgModule annotation.
Versions of Angular, ng-bootstrap and Bootstrap:
Angular CLI: 7.3.5 Angular: 7.2.9 ng-bootstrap:4.1.0 Bootstrap:4.3.1
@NgModule annotation is there, not sure what is wrong! Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Angular error: Please add a @NgModule annotation
But I get the following error: Uncaught Error: Unexpected directive 'SomeComponent' imported by the module 'SomeModule'. Please add a @NgModule ...
Read more >Unexpected directive 'Slides' imported by the module ...
Hi! I'm trying to build a very simple app: taking pictures, saving them in an array and then displaying with a slide component....
Read more >Unexpected directive imported by the module please add a ...
Uncaught Error : Unexpected value 'BrowserModule' imported by the module 'AppModule'. Please add a @NgModule annotation. Can someone from the Angular CLI team ......
Read more >unexpected directive imported by the module please add a ...
Coding example for the question unexpected directive imported by the module please add a @ngmodule annotation-angular.js.
Read more >unexpected value 'chooser' imported by the module ... - You.com
ng-bootstrap/ng-bootstrapUncaught Error: Unexpected directive 'NgbTypeahead' imported by the module 'AppModule'. Please add a @NgModule annotation.#3075.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It never says
imports: [NgbTypeahead]
(!) - I guess you’ve meantimports: [NgbTypeaheadModule]
Unexpected directive ‘NgbTypeahead’ imported by the module ‘AppModule’. Please add a @NgModule annotation.
Can anyone have a proper and exact solution for this?