Angular Components

  • view
    you may divide your screen into multiple views, each one of them being controlled by a separate component.
    Angular Components
    app.component.ts

  • selector: ‘app-root’
    Angular Components
    templateUrl: './app.component.html’

  • specifies the name of the template file for this particular component.

styleUrls: [’./app.component.scss’]

  • means that this particular SaaS file is applied to this style.

Export class
Angular Components
A component is JavaScript class or Type Script class, that’s why here defining a class saying AppComponent.
Then, you are exporting this class.

  • Q: Why using ‘export’ here?
  • A: this component can be imported into my app module.

‘title’: a local property defined inside the class

  • these properties would be accessible through to my template.