相关疑难解决方法(0)

Angular 2中表达式中问号的含义是什么?

values?.listArray这里的意思是什么?具体来说,我对问号很感兴趣.

[inputValue] = "values?.listArray"
Run Code Online (Sandbox Code Playgroud)

typescript angular

28
推荐指数
3
解决办法
2万
查看次数

如何简化 TypeScript 中是否存在属性的检查?

现在我做以下检查:

 return this.profile.organization ? this.profile.organization.shifts : null;
Run Code Online (Sandbox Code Playgroud)

我可以美化这个对财产存在的检查吗?

所以,我的意思是:

this.profile.organization.shifts || '';
Run Code Online (Sandbox Code Playgroud)

typescript

3
推荐指数
1
解决办法
4191
查看次数

标签 统计

typescript ×2

angular ×1