February 2017
Beginner to intermediate
294 pages
6h 9m
English
In order to use the collector component inside the root component (app.ts) we need to inform the root about it. So declare the CollectorComponent inside the app.modules.ts.
Notice that as soon as you add the CollectorComponent in the declarations array, WebStorm IDE imports the related class automatically.
If you are not using WebStorm, you need to manually import the collector.component.ts into the root otherwise you will get an error later:
// src/app/app.ts
//...
import {CollectorComponent}from "./collector/collector.component";
//...
Also don't forget to declare the new component in the module file:
// src/app/app.modue.ts import {CollectorComponent} from "./collector/collector.component"; //... @NgModule({ declarations: ...Read now
Unlock full access