question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Typeahead doesn't work (isn't a known property of 'input')

See original GitHub issue

angular v4.0.0 ngx-bootstrap v1.8.1

Imported module

import { TypeaheadModule } from 'ngx-bootstrap/typeahead';  

@NgModule({
..
imports: [
 TypeaheadModule.forRoot(),
..
])

When using

<input
            [(ngModel)]="selected"
            [typehead]="products"
            typeaheadOptionField="name"
            class="form-control"/>

having issue

Can't bind to 'typehead' since it isn't a known property of 'input'. ("                
                <input
                           [(ngModel)]="selected"
                           [ERROR ->][typehead]="products"
                           typeaheadOptionField="name"

and warning before the issue

Template parse warnings:
The <template> element is deprecated. Use <ng-template> instead ("
<!-- inject options list template -->
[WARNING ->]<template [ngTemplateOutlet]="optionsListTemplate || (isBs4 ? bs4Template : bs3Template)"
  [ngOutlet"): ng:///TypeaheadModule/TypeaheadContainerComponent.html@2:0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
valorkincommented, Oct 26, 2017

@debslab hey, in 90% of cases you forgot to add import of Typeahead module to module where your component is declared

2reactions
valorkincommented, Aug 18, 2017
  1. seems you need ngx-bootstrap@next version
  2. angular DI is designed in a way, that you need to import components module in any child\lazy loaded modules but call forRoot only in root module, to provide required services
Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bind to 'typeahead' since it isn't a known property of 'input'
I'm using Angular 2.1.2 and I'm having trouble using ng2-bootstrap's typeahead feature, which ...
Read more >
Can't bind to 'ngModel' since it isn't a known property of 'input'
To fix Can't bind to 'ngModel' since it isn't a known property of 'input' error in Angular we have to import FormsModule in...
Read more >
aria-autocomplete - Accessibility - MDN Web Docs - Mozilla
The aria-autocomplete property only describes the type of predictive behavior for an input element for assistive technologies; it doesn't ...
Read more >
Can you remember "Can't bind 'x' since it is not a known ...
Can't bind to 'ngForOf' since it isn't a known property of 'h1'. The problem is, it doesn't say which component, to find out...
Read more >
can't bind to 'ngmodel' since it isn't a known property of 'p ...
1. If 'p-dropdown' is an Angular component and it has 'ngModel' input, then verify that it is part of this module. 2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found