1. 父组件中调用子组件
<app-footer #footer></app-footer>
2. 父组件中调用子组件的值
<button (click)="getChildMsg()">获取子组件的msg</button>
@ViewChild('footer') footer: any;
3. 子组件中定义值
public msg = '我是子组件footer的一个msg';
标签:获取,footer,msg,ViewChild,组件,Angular
From: https://www.cnblogs.com/jahoon/p/16635795.html