我在以下位置看到过这个声明有角度的网站 https://angular.io/api/common/AsyncPipe:
this.resolve !('hi there!');
我不知道是什么!
可能意味着在这种情况下。
我遇到过非空断言运算符 https://stackoverflow.com/questions/42273853/in-typescript-what-is-the-exclamation-mark-bang-operator-when-dereferenci/42274019但我不认为这就是这里的情况。任何想法?
它是非空断言运算符。 https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator请注意,类型为this.resolve
is Function|null
所以它可能为空。
添加它是为了让编译器停止抱怨this.resolve
可能为空strictNullChecks
编译器选项打开。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)