Ngx-bootstrap: Typeahead with Bootstrap v4

Created on 11 Feb 2017  路  3Comments  路  Source: valor-software/ngx-bootstrap

The following code only works with Bootstrap v3, not with v4 unfortunately:

<!-- works -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<!-- doesn't work -->
<!-- https://v4-alpha.getbootstrap.com/dist/css/bootstrap.min.css -->
<input [(ngModel)]="selected" [typeahead]="states" class="form-control">
export class MyComponent {
  public selected:string;
  public states:string[] = ['Alabama', 'Alaska', 'Arizona', 'Arkansas',
    'California', 'Colorado',
    'Connecticut', 'Delaware', 'Florida', 'Georgia', 'Hawaii', 'Idaho',
    'Illinois', 'Indiana', 'Iowa',
    'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland', 'Massachusetts',
    'Michigan', 'Minnesota',
    'Mississippi', 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',
    'New Jersey', 'New Mexico',
    'New York', 'North Dakota', 'North Carolina', 'Ohio', 'Oklahoma', 'Oregon',
    'Pennsylvania', 'Rhode Island',
    'South Carolina', 'South Dakota', 'Tennessee', 'Texas', 'Utah', 'Vermont',
    'Virginia', 'Washington',
    'West Virginia', 'Wisconsin', 'Wyoming'];
}

(Please note that I am using SystemJS - all the other components from your library do work however)

Most helpful comment

@valorkin It would be good idea to put it near installation instructions.

All 3 comments

Have you set ngbs to run on bootstrap 4? window.__theme = 'bs4';

@GuskiS it should be added to docs somewhere, any ideas? ;)

@valorkin It would be good idea to put it near installation instructions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

juanitavollmering picture juanitavollmering  路  3Comments

webdev48 picture webdev48  路  3Comments

phmello picture phmello  路  3Comments

hugonne picture hugonne  路  3Comments

ctrl-brk picture ctrl-brk  路  3Comments