import { Component } from "@angular/core" ; import { Router } from "@angular/router" ; @ Component ( { selector : 'jp-landing' , templateUrl : 'landing.component.html' } ) export class LandingComponent { constructor ( private router ) { } openDocument ( _id ) { if ( _id ) { let pattern = /[\:/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\"\|\<\>\-\^\%\.]/g ; _id = _id . replace ( pattern , "" ) ; _id = _id . split ( " " ) . join ( "-" ) . substr ( 0 , 64 ) . toLowerCase ( ) ; let link = [ 'edit' , _id ] ; this . router . navigate ( link ) ; } } }