January 2018
Intermediate to advanced
332 pages
7h 36m
English
So, now our application is ready to go. We have added the logic to stack the states that are being navigated to and we also have the logic for when the user hits the Back button. When we put all this logic together in our app.component.ts, we have the following:
import {Component, ViewEncapsulation} from '@angular/core';import {Router, NavigationEnd} from '@angular/router';import {Stack} from "./utils/stack";@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss', './theme.scss'], encapsulation: ViewEncapsulation.None})export class AppComponent { constructor(private stack: Stack, private router: Router) { this.router.events.subscribe((val) => { if(val instanceof
Read now
Unlock full access