Angular4_给subscribe后的数据转换类型

getMakeStation(code : string | null) {
if ( code) {
this. poService. getMakeWorkStation( code). subscribe((r) => {
this. model = r.data;
this. model. isPersistent = this. convertIsPersistentToBool( this. model. isPersistent);
this. isEdit = true;
});
}
}
convertIsPersistentToBool(isPersistent : string| boolean) {
const value = isPersistent;
const flag = value === 'False' ? false : true;
return flag;
}
相关文章
相关标签/搜索