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

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.

主站蜘蛛池模板: 高雄县| 巴里| 资中县| 阜阳市| 无棣县| 渑池县| 当阳市| 隆回县| 承德市| 高清| 蕲春县| 饶阳县| 桐柏县| 白水县| 松滋市| 鄯善县| 莆田市| 江永县| 合川市| 温泉县| 运城市| 梅河口市| 余干县| 松阳县| 乐东| 龙陵县| 嘉鱼县| 大荔县| 北票市| 金昌市| 永吉县| 黄冈市| 迁安市| 阿拉善盟| 大埔县| 海晏县| 安图县| 济阳县| 兴仁县| 潼南县| 屏山县|