I am following an Angular4-Firebase integration tutorial where first they are writing following code in app.module.ts - 1.
import { AngularFireAuthModule } from 'angularfire2/auth';
imports: [
//Some other imports
AngularFireModule.initializeApp(firebaseConfig),
//Some more imports
],
Then in app.component.ts they are again importing some other firebase related stuffs -
import { AngularFireAuth } from 'angularfire2/auth';
Now I have following questions -
Why they are importing modules/dependencies at two different places in app.module.ts and app.comonent.ts. Why cant they do it at app.module.ts only.
As per my understanding, it looks like they are importing a module 'AngularFireAuthModule' in app.module.ts and then importing Firebase related components in the component file(app.component.js) where they need to use it. Is this so?
It would be great if any one can share a reference to understand module and component deeply in Angular 4. All tutorials that I am following use angular cli that generates everything at the run time and the tutorial asks to update certain code at certain places to make it work for them.
Thanks in advance.