当我使用console.log(_router.url)
时,无法获取网址。它只返回/
(斜杠)Angular 2 - 无法从路由器获取网址
当我做下面的代码:
constructor(
private el: ElementRef,
private _auth:AuthenticationService,
@Inject(AppStore) private store: Store<AppState>,
private _router:Router,
) {
console.log(_router);
console.log(_router.url);
}
时(...),结果被点击它显示"/languages"
但是当我console.log(_router.url)
这只是它打印
你得到这个解决。答案似乎不适合我。 – Hiran