如果我在Angular4父组件中使用templateUrl,我需要包含
父模板中的子组件,如<child></child>
,
我该如何实现同样的目标?
@Component({
selector: 'parent',
templateUrl: './foo.parent.html'
})
export class ParentComponent {}
子组件
@Component({
selector: 'child',
template: `
<h4>Child Component</h4>
`
})
export class ChildComponent {}
在<child></child>
文件中添加foo.parent.html
。