简体   繁体   English

Angular 2 错误映射未定义

[英]Angular 2 error Map is not defined

I edited my question because it was not clear enough (I think)我编辑了我的问题,因为它不够清楚(我认为)

I have a simple app in angular2 and I try to run it on Xbox (yes it's possible with the development kit and Visual Studio).我在 angular2 中有一个简单的应用程序,我尝试在 Xbox 上运行它(是的,可以使用开发工具包和 Visual Studio)。 I know it works with an angular 1.5 app because I already succeed.我知道它适用于 angular 1.5 应用程序,因为我已经成功了。 So, this is my stack trace when the code run (sorry my VS is partially in french) :所以,这是代码运行时的堆栈跟踪(对不起,我的 VS 部分是法语):

在此处输入图片说明

This is my index.html :这是我的 index.html :

在此处输入图片说明

And this is my systemjs.config.js :这是我的 systemjs.config.js :

在此处输入图片说明

Because I need to push my app on Xbox I had all js files I need in my visual jsproject BUT I think I forgot one but I don't know which one so... If you have an idea.因为我需要在 Xbox 上推送我的应用程序,所以我在我的可视化 jsproject 中有我需要的所有 js 文件,但我想我忘记了一个,但我不知道是哪个...如果你有想法。 Thank you !!谢谢 !! :) :)

My best guess is that you need to load the ES6 shim in your index.html file(as explained here ).我最好的猜测是,你需要加载在您的index.html文件ES6垫片(如解释在这里)。

<script src="../node_modules/core-js/client/shim.min.js"></script>

Place it before the zone.js script line(or even base.js).将它放在 zone.js 脚本行(甚至 base.js)之前。

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

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