ng-template
ng-template是angular提供的用来定义模板的标签,什么时候需要使用ng-template?,不着急,我们一步一步来,首先接着第二篇的father.component.ts,
import {Component, OnInit, ContentChild, TemplateRef, AfterViewInit,AfterContentInit, ViewChild, Input} from '@angular/core';
import { AppChild } from './child.component';
@Component({
selector:'app-father',
template:`
<div style="width:300px;height:400px;border:red 1px solid;display:flex; flex-direction: column;justify-content: space-between;">
<header style="flex:0 0 40px">
<ng-content select="header"></ng-content>
</header>
<section style="flex:1 0 auto;">
<ng-content select="section"></ng-content>
<app-child [items]="items"&g