2017-05-24 100 views
1

现在我想在Safari浏览器上运行我的angular2页面。Angular不适用于Safari浏览器

但它无法正常工作。 (它在Chrome上运行良好)。

所以我试图在StackOverflow上搜索解析,它说关于polyfill,core-js,es6-shim。

但我不知道如何使用它们。

我照着https://angular.io/docs/ts/latest/guide/browser-support.html

包括index.html中shim.min.js但浏览器控制台,如下所示。

GET http://localhost/frontend/node_modules/core-js/client/shim.min.js 404(未找到)

我试图在文件polyfills.ts进口 '国际'。 但结果是一样的。

这是我的错误日志

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://10.70.1.6/frontend/D:/Work/Project/FrontEnd/src/polyfills.js.map 

Failed to load resource: the server responded with a status of 404 (Not Found) 
http://10.70.1.6/frontend/Observable.js.map 

[Error] ERROR – TypeError: undefined is not an object (evaluating 'me.selected_group[0]') — main.bundle.js:3177 
    error 
    View_AdminSchedulesEditexistingComponent_3 
    logError (vendor.bundle.js:17953) 
    (anonymous function) 
    handleError (vendor.bundle.js:5973) 
    tick (vendor.bundle.js:9889) 
    (anonymous function) (vendor.bundle.js:9762:111) 
    invoke (polyfills.bundle.js:10900) 
    onInvoke (vendor.bundle.js:8957) 
    invoke (polyfills.bundle.js:10899) 
    run (polyfills.bundle.js:10660) 
    run (vendor.bundle.js:8825) 
    next (vendor.bundle.js:9762:86) 
    (anonymous function) (vendor.bundle.js:8659) 
    __tryOrUnsub (vendor.bundle.js:19278) 
    next (vendor.bundle.js:19225) 
    _next (vendor.bundle.js:19165) 
    next (vendor.bundle.js:19129) 
    next (vendor.bundle.js:19491) 
    emit (vendor.bundle.js:8645) 
    checkStable (vendor.bundle.js:8922) 
    onLeave (vendor.bundle.js:8998) 
    onInvokeTask (vendor.bundle.js:8951) 
    invokeTask (polyfills.bundle.js:10932) 
    runTask (polyfills.bundle.js:10700) 
    invoke (polyfills.bundle.js:10995) 
[Error] ERROR CONTEXT – DebugContext_ {view: Object, nodeIndex: 3, nodeDef: Object, …} 
    error 
    View_AdminSchedulesEditexistingComponent_3 
    logError (vendor.bundle.js:17953) 
    (anonymous function) 
    handleError (vendor.bundle.js:5978) 
    tick (vendor.bundle.js:9889) 
    (anonymous function) (vendor.bundle.js:9762:111) 
    invoke (polyfills.bundle.js:10900) 
    onInvoke (vendor.bundle.js:8957) 
    invoke (polyfills.bundle.js:10899) 
    run (polyfills.bundle.js:10660) 
    run (vendor.bundle.js:8825) 
    next (vendor.bundle.js:9762:86) 
    (anonymous function) (vendor.bundle.js:8659) 
    __tryOrUnsub (vendor.bundle.js:19278) 
    next (vendor.bundle.js:19225) 
    _next (vendor.bundle.js:19165) 
    next (vendor.bundle.js:19129) 
    next (vendor.bundle.js:19491) 
    emit (vendor.bundle.js:8645) 
    checkStable (vendor.bundle.js:8922) 
    onLeave (vendor.bundle.js:8998) 
    onInvokeTask (vendor.bundle.js:8951) 
    invokeTask (polyfills.bundle.js:10932) 
    runTask (polyfills.bundle.js:10700) 
    invoke (polyfills.bundle.js:10995) 

我怎样才能解决这个问题?我能做什么?

回答

0

如果您使用的是CLI,那么查看polyfills.ts文件。取消注释导入并安装那里提到的软件包。

+0

感谢您的回复。我使用角度cli,我知道polyfill.ts在那里。但我不知道哪些功能是为safari导入的。 – Alex

+0

我刚才有一个类似的问题,对于Safari我只是缺少进口intl import'intl'和import'intl/locale-data/jsonp/en' – Ludwig

+0

我试过import'intl';在文件polyfills.ts中。但结果是一样的。 – Alex

相关问题