PageModel
作为输入。然后您可以显示它,并查看使用
*ngFor
@Component({
selector: 'hello',
template: `
<li>{{model.title}}</li>
<ul>
<hello *ngFor="let child of model.children" [model]="child"></hello>
</ul>
`,
styles: [`h1 { font-family: Lato; }`]
})
export class HelloComponent {
@Input() model: PageModel;
}
StackBlitz example