1
각도 2 베타 14로 작성된 각도 2 앱이 있습니다.이를 rc5로 업그레이드 중입니다. 이제경로 설정시 각도 2의 이름 사용
{path:'/...',name:'LoggedIn',component:LoggedInComponent},
{path:'/auth', name:'Auth', component:AuthComponent}
나는이
import { RouterModule , Routes } from '@angular/router';
import {AuthComponent} from "./auth/auth.component";
import {LoggedInComponent} from "./auth/logged-in.component";
import {LOGGED_IN_ROUTES} from "./auth/logged-in.routes";
const APP_ROUTES : Routes = [
{ path : '/...' , name :'LoggedIn' , component : LoggedInComponent , children : LOGGED_IN_ROUTES},
{ path : '' , component : AuthComponent},
{ path : 'auth' , component : AuthComponent},
];
export const routing = RouterModule.forRoot(APP_ROUTES);
내가
같은 오류를 얻고있다처럼 일을 오전 : 나는 최신 라우터를 사용하고, 내 패키지 JSON은"@angular/router": "3.0.0-rc.1"
이전
루트 같이 구성된 포함
Type '({ path: string; name: string; component: typeof LoggedInComponent; children: Route[]; } | { path...' is not assignable to type 'Route[]'.
Type '{ path: string; name: string; component: typeof LoggedInComponent; children: Route[]; } | { path:...' is not assignable to type 'Route'.
Type '{ path: string; name: string; component: typeof LoggedInComponent; children: Route[]; }' is not assignable to type 'Route'.
Object literal may only specify known properties, and 'name' does not exist in type 'Route'.
경로 설정에서'name'을 제거하십시오 ... –