convert values range from templates to option element
This commit is contained in:
@ -40,7 +40,7 @@ export class DataService {
|
||||
if (this.collectionMap[collection].array) { // array data
|
||||
this.arr[collection] = data
|
||||
.map(e => this.collectionMap[collection].model ? new this.collectionMap[collection].model().deserialize(e) : e);
|
||||
this.id[collection] = this.arr[collection].reduce((s, e) => {s[e._id] = e; return s; }, {});
|
||||
this.idReload(collection);
|
||||
}
|
||||
else { // not array data
|
||||
this.d[collection] = new this.collectionMap[collection].model().deserialize(data);
|
||||
@ -49,4 +49,8 @@ export class DataService {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
idReload(collection) {
|
||||
this.id[collection] = this.arr[collection].reduce((s, e) => {s[e._id] = e; return s; }, {});
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user