0
중첩 된 구성 요소를 사용하고 싶습니다. 이 좋은 튜토리얼 쇼, 내가 할 수있는 방법 있음 :angular2 중첩 된 구성 요소 templateUrl을 찾을 수 없습니다.
내 문제가 중첩 된 구성 요소에 대한 내 템플릿을 찾을 수 없습니다 것을https://www.themarketingtechnologist.co/building-nested-components-in-angular-2/
: 내가 내가
template: '<h2>HALLO</h2>'
시도해야하지만 싶습니다 통근 파일을 사용하여이 같은 task.component.html :
template: 'file.component.html'
출력은, 단순히
그task.component.html
는 을 표시되며 내가하려고하면
templateUrl: 'file.component.html'
내가 얻을 오류 :
ChildComponent :
@Component({
selector: 'edit-task',
templateUrl: 'file.component.html'
})
export class FileFormat{}
다음
내 코드입니다Uncaught (in promise): Failed to load task.component.html
parentComponent에 :
@Component({
moduleId: module.id,
selector: 'my-app',
templateUrl: 'app.template.html',
directives: [FileFormat]
})
export class FileFormat{}
그게 .... 내가 잊어 버린 설정 : 'moduleId : module.id' –