mardi 11 septembre 2018

Angular two-way binding for select with object

Actually, i'm trying to bind the array of object to select input. I'm trying in this way, [(ngModel)]="users[i].roles", where 'users' is outer array and 'roles' is another array inside users. Here, roles is array of key value pairs like,

[{'code': 1, 'desc: ''},{'code': 2, 'desc: ''},{'code': 3, 'desc: ''}],

How can i bind the 'code' from this array.




Aucun commentaire:

Enregistrer un commentaire