util.isNullOrUndefined(object) 已折旧,我找不到任何替代方案。有人可以指出一个可行的替代方案吗?
if (isNullOrUndefined(this.activeAppKey) || this.activeAppKey.trim().length === 0) {
this.activeAppKey = sessionStorage.getItem(AppConstants.APP_KEY);
}
最佳答案
尝试使用 !
运算符(operator)。
if (!this.activeAppKey) {
this.activeAppKey = sessionStorage.getItem(AppConstants.APP_KEY);
}
关于angular - Util 模块中 util.isNullOrUndefined(object) 的替代方法是什么? Angular 7,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54627255/