I have a list like
Code: Select all
this.cities = [
{name: 'León', code: 'L'},
{name: 'Madrid', code: 'M'}
];
Thanks!
Code: Select all
this.cities = [
{name: 'León', code: 'L'},
{name: 'Madrid', code: 'M'}
];
Code: Select all
in TS: selectedCity: {name: string, code: string};
<p-listbox [options]="cities" [(ngModel)]="selectedCity" multiple="multiple" filter="'filter'"></p-listbox>
Code: Select all
<input
type="text"
class="address-text"
pInputText
style="width: 100%;"
(focus)="onStartTyping();"
(ngModelChange)="onTyping($event);"
[(ngModel)]="addressTyped">
in TS (on start typing is not relevant for the search);
onTyping(value) { // this is executed before ngModel is updated
this.addressTyped = value;
this.updateAddressFoundList(); --> return element.address.match(new RegExp(this.addressTyped, 'gi')); // global, ignoreCase, no accent ignore HELP!!!
}
Users browsing this forum: No registered users and 6 guests