I am new to A2, so this question was most likely asked earlier, but I use the wrong terminology, so I can not find the answer.
However, I am trying to understand the injection @Componentinside A2. As far as I can tell, all components, no matter how nested they should always be declared as part of the NgModules file at the root level (i.e. the services declared here, are accessible through all components)
@NgModule({
imports: [
...
],
declarations: [
1stComponent,
2ndComponent,
3rdComponent,
4thComponent <-- All components must be included here
],
providers: [
...
],
bootstrap: [
AppComponent
]
})
, . , ChildComponent, ParentComponent? ChildComponent NgModule? ChildComponent , ? - ? , NgModule , , ?