Add callback for ng route commands for go

This commit is contained in:
cyber-dream 2022-10-31 21:52:28 +03:00
parent f79938a76d
commit 697af17462

View File

@ -1,10 +1,20 @@
import { Component } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { Router, RouterEvent } from '@angular/router';
@Component({ @Component({
selector: 'app-root', selector: 'app-root',
templateUrl: './app.component.html', templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'], styleUrls: ['./app.component.scss'],
}) })
export class AppComponent {
export class AppComponent implements OnInit{
constructor(private router: Router){ }
ngOnInit(){
document.addEventListener('GoChangeRoute_Callback', (event:any) => {
this.router.navigate([event.detail])
console.log("here")
})
}
title = 'go-web'; title = 'go-web';
} }