angular - how to display object value of multiselect primeng angular2 -


i following https://www.primefaces.org/primeng/#/multiselect docs have information print value of string. how can display object value. this.cities.push({label:'new york', value:{id:1, name: 'new york', citycode: 'ny'}}); instance want display code. tried {{selectedcity.citycode}} displaying [obj obj]

since selectedcity array, should use *ngfor loop through items.

<div *ngfor="let city of selectedcities">   <p>{{city.id}}. {{city.citycode}} - {{city.name}}</p> </div> 

plunker demo


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -