我有以下行declare var Notification: any;
。在Typescript中声明环境变量如果不为空
它的工作很好,大部分。但在iOS上,我看到以下例外情况 - ReferenceError: Can't find variable: Notification
。 iOS似乎不支持Notification
,有没有办法检查它是否为空,如果它不声明它。类似的东西 -
if (Notification)
declare var Notification: any;