- Angular UI Development with PrimeNG
- Sudheer Jonna Oleg Varaksin
- 103字
- 2021-07-15 17:33:03
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.
推薦閱讀
- Learning Neo4j
- Oracle Database In-Memory(架構與實踐)
- 架構不再難(全5冊)
- SQL for Data Analytics
- Learning AWS Lumberyard Game Development
- Xamarin.Forms Projects
- Learning AndEngine
- Serverless架構
- Learning FuelPHP for Effective PHP Development
- uni-app跨平臺開發與應用從入門到實踐
- MongoDB Cookbook
- Android熱門應用開發詳解
- Serverless工程實踐:從入門到進階
- IBM DB2 9.7 Advanced Application Developer Cookbook
- Practical Time Series Analysis