简体   繁体   中英

Unable to run Angular2 application in Android WebView API 21

I am trying to load an Angular2 application in an Android hybrid app which uses WebView. The SDK version is 21.

I am not able to load the app. It is not able to load boot.js module.

        Errormessage: "undefined is not a function↵ 
Error loading http://example.com/mobile/boot.js"stack: 

"TypeError: undefined is not a function↵    
    at http://example.com/mobile/node_modules/angular2/bundles/angular2.dev.js:764:10↵    
    at http://example.com/mobile/node_modules/angular2/bundles/angular2.dev.js:779:5↵    
    at linkDynamicModule (http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2921:32)↵    
    at getModule (http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2889:9)↵    
    at http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2925:16↵    
    at http://example.com/mobile/node_modules/angular2/bundles/angular2.dev.js:11425:22↵    
    at linkDynamicModule (http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2921:32)↵    
    at getModule (http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2889:9)↵    
    at http://example.com/mobile/node_modules/systemjs/dist/system.src.js:2925:16↵    
    at http://example.com/mobile/node_modules/angular2/bundles/angular2.dev.js:13555:20"

It seems to be a problem with the compatibility of SystemJS with the WebView that I am using. Has anyone encountered the same issue?

添加SystemJS polyfills对我有用。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM