Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't bind to 'list' since it isn't a known property of 'typeahead' #26

Open
davedastrange opened this issue Dec 26, 2016 · 4 comments
Open

Comments

@davedastrange
Copy link

("
<typeahead
[(ngModel)]="selectedFruit"
[ERROR ->][list]="fruits"
[searchProperty]="'searchText'" [displayProperty]="'name'"
[maxSuggestions]="2"
"): PortSearchComponent@6:2
Can't bind to 'searchProperty' since it isn't a known property of 'typeahead'. ("
[(ngModel)]="selectedFruit"
[list]="fruits"
[ERROR ->][searchProperty]="'searchText'" [displayProperty]="'name'"
[maxSuggestions]="2"
(suggestionSelect"): PortSearchComponent@7:2
Can't bind to 'displayProperty' since it isn't a known property of 'typeahead'. ("
[(ngModel)]="selectedFruit"
[list]="fruits"
[searchProperty]="'searchText'" [ERROR ->][displayProperty]="'name'"
[maxSuggestions]="2"
(suggestionSelected)="fruitSelected($event)"
"): PortSearchComponent@7:34
Can't bind to 'maxSuggestions' since it isn't a known property of 'typeahead'. ("
[list]="fruits"
[searchProperty]="'searchText'" [displayProperty]="'name'"
[ERROR ->][maxSuggestions]="2"
(suggestionSelected)="fruitSelected($event)"
placeholder="Begin typing a fru"): PortSearchComponent@8:2
'typeahead' is not a known element:

  1. If 'typeahead' is an Angular component, then verify that it is part of this module.
  2. If 'typeahead' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
@meetmicah
Copy link

I had this issue, and fixed it by adding this to my app.module.ts

import { Typeahead } from 'ng2-typeahead';

And then adding it to my @NgModule declarations:

@NgModule({ declarations: [ Typeahead, ] })

@dipakpurbey
Copy link

dipakpurbey commented Aug 3, 2017

@meetmicah - when I implemented your solution, I get the following error:

Unexpected value 'Typeahead' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@component annotation.

Any inputs on these ?

@meetmicah
Copy link

@dipakpurbey Did you forget to add an '@' somewhere? Similar to this one: https://stackoverflow.com/questions/40363060/angular-2-error-when-declaring-custom-pipe-on-appmodule

@dipakpurbey
Copy link

@meetmicah just re-checked. no I have not left it somewhere. Already tested the application by commenting out the typeahead lines in app.module.ts, the app runs fine but when i insert the Typeahead in declarations array of NgModule, the error comes back. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants