我有以下行declare var Notification: any;
。在Typescript中聲明環境變量如果不爲空
它的工作很好,大部分。但在iOS上,我看到以下例外情況 - ReferenceError: Can't find variable: Notification
。 iOS似乎不支持Notification
,有沒有辦法檢查它是否爲空,如果它不聲明它。類似的東西 -
if (Notification)
declare var Notification: any;