简体   繁体   中英

How to bind the json value element to the array in angular 4

For example:

this.tenants = [];

this.list = [
    {id: "123", displayname: "john"}, 
    {id: "456", displayname: "victor"}, 
    {id: "789", displayname: "adam"}
];

this.tenants = this.list;

使用slice方法:

this.tenants = this.list.slice();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM