我收到此錯誤,當我更新到nativescript-angular
的最後一個版本時,我想這個問題與我使用的版本Angular 2
和模塊使用的版本有所不同。有人能告訴我什麼是我應該使用的正確版本來使它工作? 請注意,我打算升級到nativescript-angular
的最後一個版本是使用RouterExtensions
。角度2:類型'Route []'的參數不能分配給類型'Route []'的參數。
Argument of type 'Route[]' is not assignable to parameter of type 'Route[]'.
Type 'Route' is not assignable to type 'Route'.
Types of property 'pathMatch' are incompatible.
Type 'string' is not assignable to type '"full" | "prefix"'.
Type 'string' is not assignable to type '"prefix"'.
const routes: Route[]
這些都是我的package.json依賴關係:
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.3.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/platform-server": "2.0.0-rc.4",
"@angular/router": "^3.0.0-rc.1",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.4",
"nativescript-angular": "^0.3.1",
"nativescript-plugin-firebase": "^3.5.3",
"reflect-metadata": "^0.1.8",
"rxjs": "5.0.0-beta.6",
"tns-core-modules": "^2.3.0-2016-08-29-3966",
"zone.js": "^0.6.17"
},
的app.routes.ts:
import { RouterConfig } from '@angular/router';
import { nsProvideRouter} from 'nativescript-angular/router';
import { LoginComponent } from './components/login.component';
import { DashboardComponent } from './components/dashboard.component';
const routes: RouterConfig = [
{
path: '',
redirectTo: '/login',
terminal: true
},
{
path: 'login',
component: LoginComponent
},
{
path: 'dashboard',
component: DashboardComponent
}
];
export const APP_ROUTER_PROVIDERS = [
nsProvideRouter(routes, { enableTracing: false })
];
聽起來像你正在從2個不同的包中導入'Route'。 –