Skip to main content
edited body
Source Link
Cagri Tacyildiz
  • 17.7k
  • 6
  • 38
  • 61

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset isid to input so you don't need to bind anything just give id of datalist

for html

<input list="browsers"> <datalist id="browsers"> <option *ngFor="let data of datas" value="{{data}}"> </datalist> 

for component.ts

datas=[ "test1","test2","abc","xyz"] 

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

for html

<input list="browsers"> <datalist id="browsers"> <option *ngFor="let data of datas" value="{{data}}"> </datalist> 

for component.ts

datas=[ "test1","test2","abc","xyz"] 

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset id to input so you don't need to bind anything just give id of datalist

for html

<input list="browsers"> <datalist id="browsers"> <option *ngFor="let data of datas" value="{{data}}"> </datalist> 

for component.ts

datas=[ "test1","test2","abc","xyz"] 
added 221 characters in body
Source Link
Cagri Tacyildiz
  • 17.7k
  • 6
  • 38
  • 61

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

for html

<input list="browsers"> <datalist id="browsers"> <option *ngFor="let data of datas" value="{{data}}"> </datalist> 

for component.ts

datas=[ "test1","test2","abc","xyz"] 

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

for html

<input list="browsers"> <datalist id="browsers"> <option *ngFor="let data of datas" value="{{data}}"> </datalist> 

for component.ts

datas=[ "test1","test2","abc","xyz"] 
deleted 2 characters in body
Source Link
Cagri Tacyildiz
  • 17.7k
  • 6
  • 38
  • 61

Demo You can try list="{{param}}"list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

You can try list="{{param}}" rather than [list]="param"

Demo You can try list="dataListId" rather than [list]="param"

[list] is binding method. But for autocomplete options. You need to give dataset is to input so you don't need to bind anything just give id of datalist

Source Link
Cagri Tacyildiz
  • 17.7k
  • 6
  • 38
  • 61
Loading