Angular4_给subscribe后的数据转换类型

前端之家收集整理的这篇文章主要介绍了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;
}

猜你在找的Angularjs相关文章