Angular Components
-
view
you may divide your screen into multiple views, each one of them being controlled by a separate component.
app.component.ts -
selector: ‘app-root’
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
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.