angular-cli
을 사용하여 2 개의 다른 프로젝트를 만들었습니다. 둘 다 완벽하게 작동하지만 그 중 하나에 routeConfig
은 null
이고 무엇이 잘못되었는지 전혀 모른다.ActivatedRoute.routeConfig가 null입니다. Angular-cli로 된 Angular 2 프로젝트
두 파일의 package.json
은 동일하므로 패키지 버전에 대한 의심의 여지가 없습니다. app.modules
파일도 동일합니다.
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
constructor(
private router: ActivatedRoute
) { }
ngOnInit(): void {
console.log(this.router.routeConfig);
}
}
내 구현 무슨 일이야 : 여기
내가 두 프로젝트에 routeConfig
얼마나입니까?