![](/img/trans.png)
[英]Error when using UpgradeModule upgrading from AngularJS 1.5 to Angular 5
[英]Cannot import UpgradeModule from @angular\upgrade\static Angular V2.2.1
我目前正在將AngularJS(ng1)應用程序升級到Angular 2(ng2)。
我正在使用Angular 2.2.1版本。
當我從@angular \\ upgrade \\ static導入UpgradeModule時,出現以下異常: Uncaught SyntaxError: Unexpected reserved word
Uncaught ReferenceError: webpackJsnop is not defined
我正在使用WebPack V1.13.1。
當我使用upgrade_adapter方法時,我需要添加@Inject批注。
謝謝您的幫助。
這可能是一個Angular錯誤。 您可以通過刪除此文件來臨時修復一下您正在做的事情:
node_modules/@angular/upgrade/static.js
這是因為webpack正在優先處理以下文件,這就是為什么它會引發該異常的原因:
node_modules/@angular/upgrade/static/package.json
我想對此置評,但我沒有足夠的聲譽將其保留。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.