Tuesday, 13 June 2017

NG2- Router in Angular 2 component

import { Router } from '@angular/router';

export class App
Component{


construcot(private router: Router) {
    this.windowSize = window.innerWidth;
    this.url = router.url.split('/');
    this.arraylength = this.url.length;
    this.category = this.url[this.arraylength - 2];
    this.uniqueId = unescape(this.url[this.arraylength - 1]);


}

}

No comments:

Post a Comment

React Windowing or List virtualization - React App optimization

  Windowing  or   List virtualization   is a concept of only rendering or write the visible portion in the current   “ window ”   to the   D...