扩展RouterOutlet时如何获取目标url路径

时间:2016-06-13 18:27:22

标签: angular angular2-routing

我正在处理角度rc1并尝试扩展RouterOutlet,正如已解答here

load(factory, providers, outletMap: RouterOutletMap): any {
    super.load(factory, providers, outletMap);
    let currentUrl = (<Location>location).pathname;
    if (currentUrl == "/someUrl"){
        //do something with it
    }

    return this.loadedComponent;
}

我可以获得当前的网址,但我需要有目标。我怎么能得到它?

0 个答案:

没有答案