2016-09-28 4 views
0

私は、次のthisに続いて、やったイオン2エラーTS2339:不動産の種類には存在しない '診断' 'CordovaPlugins'

を使用しています:

cordova plugin add cordova.plugins.diagnostic 
npm install -g typings 
typings install dt~cordova --save --global 

app.ts

if (window.cordova && cordova.plugins) { 
     cordova.plugins.diagnostic.isLocationEnabled(function (enabled) { 
     alert("Location is " + (enabled ? "enabled" : "disabled")); 
     }, function (error) { 
     alert("The following error occurred: " + error); 
     }); 
    } 
    } 

私は次のエラーを取得する:

error TS2339: Property 'diagnostic' does not exist on type 'CordovaPlugins'.

window.cordovaundefinedです。

誰かがCordova Pluginをどのように動かせるかアドバイスできたら、私はそれを感謝します。イオン2用

おかげ

答えて

0

そうは、cordova.pluginsの代わりに[ 'プラグイン']ウィンドウを試してみてください。

関連する問題