import { Component, OnInit } from '@angular/core'; import { Router} from '@angular/router'; @Component({ selector: 'app-action-bar', templateUrl: './action-bar.component.html', styleUrls: ['./action-bar.component.scss'] }) export class ActionBarComponent implements OnInit { constructor( private router: Router ) { } ngOnInit(): void { } navigate(iparam: number){ this.router.navigateByUrl('/', { skipLocationChange: true }); //this will supress url change if (iparam === 1){ this.router.navigateByUrl('/settings/core-value', { skipLocationChange: true }); } if (iparam === 2){ this.router.navigateByUrl('/goals', { skipLocationChange: true }); } } }