從Beta-17遷移到RC4後,我遇到了很少問題。我收到以下編譯錯誤angular2中遷移到RC4後的問題
引導錯誤
/// < reference path="../node_modules/angular2-in-memory-web-api/typings/browser.d.ts" >
import {bootstrap} from '@angular/platform-browser';
Error: Module "../platform-browser/index" as no exported member bootstrap
路由器錯誤
import {ROUTER_PROVIDERS, RouteConfig, ROUTER_DIRECTIVES, RouteParams, ROUTER_BINDINGS} from '@angular/router';
Error: Cannot find module '@angular/router'
我試圖與路由器棄用的爲好,還是越來越沒有找到模塊錯誤
import {ROUTER_PROVIDERS, RouteConfig, ROUTER_DIRECTIVES, RouteParams, ROUTER_BINDINGS} from '@angular/router-deprecated';
Error: Cannot find module '@angular/router-deprecated'
如果現有的路由器已被棄用,那麼實現路由的新方法是什麼ING?
我在以下documentation URL中驗證過,但無法注意到很多不同之處。
任何人都可以分享一些光?
更新爲每點評:新一系列的錯誤
我能導入引導現在的路由器,但我得到了一些其他錯誤
錯誤#1,不能進口RouteConfig
import { ROUTER_DIRECTIVES, RouterOutlet, RouteConfig } from '@angular/router';
Error: Module "../angular/router/index has no exported member RouteConfig"
爲了使路由器棄用即我現有路線的執行工作,我需要進口RouteConfig。 我不知道我在哪裏可以導入RouteConfig
除了這個,我越來越近210編譯錯誤像下面。當我搜索了以下錯誤,建議增加以下行
/// ../node_modules/angular2/typings/browser.d.ts」 />
但隨着部分遷移的我已經添加下面的線
/// < reference path="../node_modules/angular2-in-memory-web-api/typings/browser.d.ts" >
錯誤:
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\async.d.ts 34 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\async.d.ts 35 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 9 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 15 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 16 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 17 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 17 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 18 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 18 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 19 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 19 Active
Error TS2304 Cannot find name 'Promise'. TypeScript Virtual Projects ..\node_modules\@angular\core\src\facade\promise.d.ts 20 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\repeat.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\retry.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\retryWhen.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\sample.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\sampleTime.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\scan.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\share.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\single.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skip.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skipUntil.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\skipWhile.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\startWith.d.ts 2 Active
Error TS2664 Invalid module name in augmentation, module '../../Observable' cannot be found. TypeScript Virtual Projects ..\node_modules\rxjs\add\operator\subscribeOn.d.ts 2 Active
雖然現在看起來好像Krishnan的代碼工作,但我已經看到ES2664無效的模塊名稱與Observable模塊使用Visual Studio 2015(更新3),顯然也出現在更新2和VS2013中 - 在我的情況下由於VS TypeScript工具問題,並且下面的URL有一個解決方法:https://github.com/Microsoft/TypeScript/issues/8518 – Jamie