Angular2 plnkr error

末鹿安然 提交于 2019-12-02 08:54:46

问题


I am working on OS ubuntu 14.04 LTS and Google Chrome Browser Version 43.0.2357.130 (64-bit) to run Angular2 projects. But in most cases while searching something for angular2 i found number of plnkr is not working on this specified Operating system. everytime i got some kind of errors like

Uncaught TypeError: m.values is not a function

Uncaught TypeError: e.values is not a function

why these error occured. while all those plnkr's are working fine on windows or any other platform. is this any bug with angular2 or something else ? just want to use ng2-bootstrap for angular2 project but same error occured again for this website

http://valor-software.com/ng2-bootstrap/

this link works on windows but not on ubuntu why ? for just reference i am posting this image.


回答1:


This is because angular2 uses Map, which is part of the es6 draft. Since this is not yet implemented in every browser you'll need to polyfill it and that's what es6-shim is for (see compatibility table). I'm a little bit surprised that that chrome version doesn't still support it, but to be honest I don't know in what version they did add support for Maps. By using Chrome you should be good by just updating it to the latest version (48.0.2564.109 m at the moment I write this answer).

If you're using older browsers (even not that old), like IE, safari, Android browsers, etc, that doesn't support Maps you'll have to polyfill it.

See the quickstart guide under Add the index.html and see the polyfills required to make it work in other browsers.

Reference

  • angular2.dev.js:4045 Uncaught TypeError: m.values is not a function.


来源:https://stackoverflow.com/questions/35409958/angular2-plnkr-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!