我无法推荐孩子 在父级中,甚至我已经在module.ts中定义了子级组件
@Component({
selector: 'app-cockpit',
template: '<p>cockpit-works</p>'
})
app.Module.ts
@NgModule({
declarations: [
AppComponent,
CockpitComponent, // Here its defined
ServerCollectionComponent
],
app.component.ts
@Component({
selector: 'app-root',
template: `<h1>Parent Component</h1>
<div><app-cockpit></app-cockpit>
</div>`,
styleUrls: ['./app.component.css']
})
我能够获得cockpit.component.ts的HTML