In the Angular2 tutorial, a detailed component is introduced by adding it to @NgModule .
Instead, I would like to add it with an external component ( AppComponent ) somehow importing it, so that only the external component refers to the internal component.
I can’t figure out how to do this. Older examples relate to the directives property, but directives no longer exists in the ComponentMetadtaType type. So it does not work.
import { HeroDetailComponent } from './hero-detail.component'; @Component({ selector: 'my-app', [..] directives: [HeroDetailComponent] })
source share