I am afraid by adding an autocomplete selection box to my site. I would like the autocomplete select box to be populated with values from my mongoDB. To get these values, I use my function:
component.ts
this.availableFirmware = [];
this.terminalService.getFirmware().subscribe(firmware => {
this.availableFirmware = firmware.firmware;
component.html
<select class="form-control" id="sel2" [(ngModel)]="firmware" name="firmware">
<option *ngFor="let firmware of availableFirmware" [value]="firmware._id">
{{firmware.name}}
</option>
</select>
this still works, but I need the field to be an autocomplete field that searches for everything. Therefore, if my array would look like this:
[
'John Doe',
'Christian Bale'
'Jenny Doehler'
]
I want the function to return John Doe
and Jenny Doehler
when I type oe
.
, , angular 2 http://material.angular.io. , , .. Pp. 'm , MongoDB.
, - !
, : →
this.availableFirmware = [];
this.terminalService.getFirmware().subscribe(firmware => {
this.availableFirmware = firmware.firmware;
console.log(this.availableFirmware);
});
:
, . , , this.availableFirmware , , - , .