官术网_书友最值得收藏!

Working with objects

Until now, AutoComplete has shown its power on primitive types, but it can work with object types as well. The value passed to the model would be an object instance, but the field property defines the label to be displayed as a suggestion. That is, in this case, the field property is used to display any property of the object as a label. The following example shows the power of the object usage:

<p-autoComplete id="instance" [(ngModel)]="countryInstance" name="instance"
[suggestions]="filteredCountryInstances"
(completeMethod)="filterCountryInstances($event)" field="name">
</p-autoComplete>

In the preceding example, the Country object is used as a model object instance and the suggestions displayed are from the country using the name field property.

主站蜘蛛池模板: 阿勒泰市| 固镇县| 五寨县| 双牌县| 错那县| 峡江县| 建水县| 东乌珠穆沁旗| 麻阳| 离岛区| 澜沧| 鲜城| 喀什市| 民乐县| 兴义市| 什邡市| 石棉县| 邻水| 北海市| 灵宝市| 丰都县| 万盛区| 菏泽市| 邯郸县| 大埔县| 西青区| 南木林县| 彭泽县| 大港区| 新郑市| 额尔古纳市| 绥滨县| 九龙县| 枞阳县| 靖远县| 洛宁县| 安溪县| 循化| 韶关市| 松潘县| 股票|