get page link angular

Solutions on MaxInterview for get page link angular by the best coders in the world

showing results for - "get page link angular"
Mathilda
29 Jun 2016
1import { Component } from '@angular/core';
2import { Router } from '@angular/router';
3
4@Component({
5    template: 'The href is: {{href}}'
6    /*    Other component settings    */
7})
8export class Component {
9    public href: string = "";
10
11    constructor(private router: Router) {}
12
13    ngOnInit() {
14        this.href = this.router.url;
15        console.log(this.router.url);
16    }
17}