林試圖利用離子2和離子本地plugin.but它給我這個錯誤,當我把我的sourceType: Camera.PictureSourceType.PHOTOLIBRARY
離子2 - 原始異常:類型錯誤:無法讀取屬性「FILE_URI」未定義
可以有一個人幫助我在這裏
錯誤日誌
app.bundle.js:2265 Uncaught EXCEPTION: Error during evaluation of "click"
ORIGINAL EXCEPTION: TypeError: Cannot read property 'PHOTOLIBRARY' of undefined
ORIGINAL STACKTRACE:
TypeError: Cannot read property 'PHOTOLIBRARY' of undefined
at AdminPage.getImage (http://localhost:8100/build/js/app.bundle.js:63654:65)
at AbstractChangeDetector.ChangeDetector_AdminPage_0.handleEventInternal (viewFactory_AdminPage:482:33)
at AbstractChangeDetector.handleEvent (http://localhost:8100/build/js/app.bundle.js:14022:30)
at AppView.triggerEventHandlers (http://localhost:8100/build/js/app.bundle.js:18329:37)
at eval (viewFactory_AdminPage:885:106)
at http://localhost:8100/build/js/app.bundle.js:33471:37
at http://localhost:8100/build/js/app.bundle.js:32848:87
at Zone.run (http://localhost:8100/build/js/app.bundle.js:2258:25)
at Zone.run (http://localhost:8100/build/js/app.bundle.js:17573:43)
at NgZone.run (http://localhost:8100/build/js/app.bundle.js:17521:41)
ERROR CONTEXT:
[object Object]Zone.run @ app.bundle.js:2265zoneBoundFn @ app.bundle.js:2235
碼 -
getImage(){
var options = {
sourceType: Camera.PictureSourceType.PHOTOLIBRARY
};
Camera.getPicture(options).then((imageData) => {
// imageData is either a base64 encoded string or a file URI
// If it's base64:
let base64Image = "data:image/jpeg;base64," + imageData;
}, (err) => {
});
};