1、子组件
//.tsexport class ContentComponent implements OnInit {public msg:string = "我是子组件"constructor() { }ngOnInit() {}}
2、父组件
//父组件.html<app-content #content></app-content><p>{{content.msg}}</p>
//.tsimport { Component, ViewChild } from '@angular/core';...export class AppComponent {title = 'my-ng-app02';@ViewChild('content',{static:false}) content:any}
