我有一個配置了ng2.0.0-beta.0的apache cordova typescript項目,並在啓動時成功工作,請參閱package.json和javascript控制檯輸出如下。從ng2.0.0-beta.0移動到ng2.0.0-beta.7的錯誤
我試圖轉移到當前在該項目中的ng2.0.0-beta.7包,看看它是否解決了意外的問題,我遇到了當模板引用類成員變量更改時視圖沒有更新的地方,詳細信息請參閱「cordova app angular 2 member variable update not updating template reference to it」。
當我切換到ng2.0.0-beta.7包一切transpiles罰款,但NG2沒有成功啓動,請參見下面的package.json和JavaScript控制檯輸出。
我對https://github.com/myusrn/acu6withng2的master分支中的ng2.0.0-beta.0情況和acu6withng27主題分支https://github.com/myusrn/acu6withng2/tree/acu6withng27中的ng2.0.0-beta.7情況有repro。
任何人都見過ng2.0.0-beta.7這個運行時錯誤,如果是的話是由於一些步驟我俯瞰或許有它的已知解決?
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-β 0.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/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>
我不使用測試版7.0還沒有,但似乎根據公測7.0看https://github.com/angular/angular/blob/master/CHANGELOG.md#200-beta7-2016-更新日誌有沒有什麼變化02-18 –
你能提供你的主HTML文件的內容嗎? (腳本,SystemJS配置,...)謝謝! –
嗨@Pardeep,謝謝你的回覆。我同意,從ng2.0.0-beta.6到.7沒有什麼變化,但是如果我正在閱讀那個更改日誌頁面的詳細信息,看起來好像很多從ng2.0.0.0-beta.0到.7的更改正確。 – myusrn