问题描述
我工作的OS Ubuntu的LTS 14.04
和谷歌Chrome浏览器版本43.0.2357.130(64位)
运行Angular2项目。
但在大多数情况下,而angular2寻找的东西,我发现plnkr数量不工作这个指定的操作系统上。
每次我得到了一些错误类型像
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
未捕获类型错误:m.values不是一个函数
未捕获类型错误:e.values不是一个函数
Uncaught TypeError: e.values is not a function
为什么这些错误发生。而所有这些plnkr的是在Windows或其它任何平台上工作的罚款。这与angular2或别的东西的错误?
只想用NG2自举了angular2项目,但同样的错误再次本网站发生
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
这个链接适用于Windows,但不是在Ubuntu,为什么?只是引用我张贴了这张图片。
this link works on windows but not on ubuntu why ? for just reference i am posting this image.
推荐答案
这是因为angular2用途的,这是的 ES6草案。由于这是尚未在每个浏览器实现的,您需要填充工具它,这就是)。我有点惊讶的是Chrome浏览器版本不支持仍在,但说实话,我不知道是什么版本他们增加对地图的支持。通过使用Chrome,你应该只需更新它的最新版本是好的( 48.0.2564.109米的此刻我写这个答案)。
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).
如果您正在使用旧的浏览器(甚至没有那么老),如IE,Safari浏览器,Android的浏览器等,不支持地图,你就必须填充工具吧。
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.
查看所需/ strong>并看到polyfills使它在其他浏览器。
See the quickstart guide under Add the index.html and see the polyfills required to make it work in other browsers.
参考
- angular2.dev.js:4045 Uncaught TypeError: m.values is not a function.
这篇关于Angular2 plnkr错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!