December 2017
Beginner
372 pages
10h 32m
English
We don't have much logic in our header file as of now, apart from the HTML and some routing link. Hence, in our component file, we just define the component decorator and bind the HTML and CSS to the component. Check out the code for our component file:
import { Component, OnInit } from '@angular/core';@Component({ selector: 'snc-header', templateUrl: './header.component.html', styleUrls: ['./header.component.css']})export class HeaderComponent implements OnInit { constructor() { } ngOnInit() { }}
The interesting thing to note here is that, had we generated our header component with the Angular CLI, it would have autogenerated the preceding code. In the preceding code, we just have a component decorator, which defines ...
Read now
Unlock full access