📜  以角度添加到按钮的路由 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:13.937000             🧑  作者: Mango

代码示例1
    

// myComponent.component.ts file 
import { Router } from '@angular/router';

constructor(private router: Router) {

}
// myComponent.component.thml
btnClick= function () {
        this.router.navigateByUrl('/user');
};