convert values range from templates to option element

This commit is contained in:
VLE2FE
2020-08-06 15:23:44 +02:00
parent 4376adc1eb
commit 56cd4dcbcc
4 changed files with 63 additions and 27 deletions

View File

@ -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; }, {});
}
}