내 개인 웹 사이트를 다시 디자인하기 위해 각도 2를 배우려고 시도하지만 내 탐색 표시 줄에서 해당 경로를 클릭 할 때 내 구성 요소가로드되지 않습니다. 내 navbar.html에서 라우터 콘센트가 내 구성 요소를 작동하지 않습니다
난이 링크가 있습니다 <li><a [routerLink]="['Home']"><i class="fa fa-home"></i></a></li>
<li><a [routerLink]="['Langages']">Langages</a></li>
을하고 난 @RouteConfig 내 app.component.ts 내 경로를 선언
{path: '/', name: 'Home', component: HomeComponent, useAsDefault: true},
{path: '/langages', name: 'Langages', component: LangagesComponent},
내 app.component에 .ts 나는 내 탐색 표시 줄을 볼 수있는 템플릿이 있고 아래에 내가 내 HomeComponent를 볼 태그를 추가하고 페이지를 전환하면 HomeCponent가 아니라 내 LangagesComponent를 볼 수 있습니다.이 순간에 HomeComponent 및 다른 구성 요소.
P.S : 내 LangagesComponent에 내가있다 :
import {Component} from "angular2/core";
@Component({
templateUrl: "./dev/langages/langages.html"
})
export class LangagesComponent {}
당신의 도움에 감사드립니다. 경로 구성에서
{path: '', component: HomeComponent, pathMatch: 'full'},
{path: 'langages', component: LangagesComponent},
path
<li><a [routerLink]="['/']"><i class="fa fa-home"></i></a></li>
<li><a [routerLink]="['/langages']">Langages</a></li>
는 선도적 인
/
를 포함 할 수 없습니다 루트에서
나는이 튜토리얼 2 각도 배우 : https://www.youtube.com/watch?v=fyfY5aqbLNI&list=PL55RiY5tL51olfU2IEqr455EYLkrhmh3n&index=2을 나는 URL 변경이 있고 난에 가면 난 내 구성 요소를로드하지 않도록/langages 또는 내 구성 요소 HomeComponent in "/" – ryfl
2016 년 1 월에 게시되었습니다.이 내용은 beta.1에 관한 내용입니다. https://github.com/angular/angular/blob/master/CHANGELOG.md#200-beta1-catamorphic- involution-2016-01-08 이후 변경된 사항을 직접 확인하십시오. –