错误从ng2.0.0-beta.0移至ng2.0.0-beta.7 [英] errors moving from ng2.0.0-beta.0 to ng2.0.0-beta.7

查看:34
本文介绍了错误从ng2.0.0-beta.0移至ng2.0.0-beta.7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个配置了ng2.0.0-beta.0软件包的apache cordova打字稿项目,并且已成功启动,请参见下面的package.json和javascript控制台输出.

I have an apache cordova typescript project with ng2.0.0-beta.0 package configured and successfully working on startup, see package.json and javascript console output below.

我正尝试移至该项目中的当前ng2.0.0-beta.7软件包,以查看它是否解决了意外问题,当我更改模板引用的类成员变量时,视图未更新,有关详细信息,请参见" cordova应用程序角度2成员变量未更新正在更新对其的模板引用".

I was attempting to move to the current ng2.0.0-beta.7 package in that project to see if it address an unexpected issue I am experiencing where views are not updating when template referenced class member variables changed, for details see "cordova app angular 2 member variable update not updating template reference to it".

当我切换到ng2.0.0-beta.7软件包时,一切都可以正常编译,但是ng2无法成功启动,请参见下面的package.json和javascript控制台输出.

When I switch to ng2.0.0-beta.7 package everything transpiles fine but ng2 doesn't successfully startup, see package.json and javascript console output below.

我在 https://github的主分支中对ng2.0.0-beta.0的情况进行了复制.com/myusrn/acu6withng2 和ng2.0.0-beta.7在acu6withng27主题分支https://github.com/myusrn/acu6withng2/tree/acu6withng27 .

I have repro for the ng2.0.0-beta.0 case in master branch of https://github.com/myusrn/acu6withng2 and ng2.0.0-beta.7 case in acu6withng27 topic branch https://github.com/myusrn/acu6withng2/tree/acu6withng27.

任何人都看到过ng2.0.0-beta.7出现此运行时错误,如果是的话,是由于我忽略了某些步骤还是有已知的解决方法?

Anyone seen this runtime error with ng2.0.0-beta.7 and if so is it due to some step i'm overlooking or perhaps there is a known fix for it?

ng2.0.0-beta.7 package.json

"dependencies": {
    "angular2": "2.0.0-beta.7",
    "es6-promise": "3.0.2",
    "es6-shim": "0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "systemjs": "0.19.9",
    "zone.js": "0.5.10"
  },

ng2.0.0-beta.7运行时javascript控制台输出错误

Uncaught TypeError: Cannot redefine property: onreadystatechange
angular2-polyfills.js (1569,25)
DEPRECATION WARNING: 'enqueueTask' is no longer supported and will be removed in next major release. Use addTask/addRepeatingTask/addMicroTask
angular2-polyfills.js (1152,18)
DEPRECATION WARNING: 'dequeueTask' is no longer supported and will be removed in next major release. Use removeTask/removeRepeatingTask/removeMicroTask
angular2-polyfills.js (1152,18)
reflect-metadata shim is required when using class decorators
    Error loading http://localhost:4400/app/main.js
angular2-polyfills.js (468,17)

ng2.0.0-beta.0 package.json

"dependencies": {
    "angular2": "2.0.0-beta.0",
    "es6-promise": "3.0.2",
    "es6-shim": "0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.0",
    "systemjs": "0.19.9",
    "zone.js": "0.5.10"
  },

ng2.0.0-beta.0运行时JavaScript控制台输出

Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.
angular2.dev.js (351,13)

ng2.0.0-beta.0/.7 index.html

<!-- Cordova reference, this is added to your app when it's built. -->
<script src="cordova.js"></script>
<script src="scripts/platformOverrides.js"></script>
<!--<script src="scripts/appbundle.js"></script>-->
<script src="scripts/index.js"></script>

<!-- 1. Load libraries needed for ng2 -->
<script src="node_modules/es6-shim/es6-shim.js"></script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<script src="node_modules/rxjs/bundles/Rx.js"></script>
<script src="node_modules/angular2/bundles/angular2.dev.js"></script>
<script src="node_modules/angular2/bundles/router.dev.js"></script>
<script src="node_modules/angular2/bundles/http.dev.js"></script>

推荐答案

我找到了解决方案,该解决方案涉及将以下内容简单地添加到index.html脚本标签列表中,并使用新的ng 2.0.0-beta.8软件包作为好吧.

I found a resolution to this which involved simply adding the following to index.html script tags list and worked with new ng 2.0.0-beta.8 package as well.

<script src="node_modules/reflect-metadata/Reflect.js"></script>

由于此详细信息不属于当前 https://angular.io/guide/quickstart 我不确定差异是否是我的hello world项目环境存在问题,还是需要添加到index.html脚本标记中应包含的内容的快速入门笔记中.

Since this detail isn't a part of the current https://angular.io/guide/quickstart I'm not sure if the difference is a problem with my hello world project environment or a detail that needs to get added to quickstart notes on what should go in index.html script tags.

这篇关于错误从ng2.0.0-beta.0移至ng2.0.0-beta.7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆