简体   繁体   English

无法在Android WebView API 21中运行Angular2应用程序

[英]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. 我正在尝试在使用WebView的Android混合应用程序中加载Angular2应用程序。 The SDK version is 21. SDK版本为21。

I am not able to load the app. 我无法加载该应用程序。 It is not able to load boot.js module. 它无法加载boot.js模块。

        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. SystemJS与我使用的WebView的兼容性似乎是一个问题。 Has anyone encountered the same issue? 有没有人遇到过同样的问题?

添加SystemJS polyfills对我有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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