本文整理汇总了TypeScript中@angular/router-deprecated.Router.isRouteActive方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Router.isRouteActive方法的具体用法?TypeScript Router.isRouteActive怎么用?TypeScript Router.isRouteActive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/router-deprecated.Router
的用法示例。
在下文中一共展示了Router.isRouteActive方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isRouteActive
public isRouteActive(routeInQuestion) {
if (routeInQuestion == null) {
return false;
}
if (routeInQuestion == AppConfig.ROUTE_NAME_ADMIN) {
var currentInstruction = this._router.currentInstruction;
if (currentInstruction == null) {
return false;
}
return currentInstruction.component.urlPath == 'admin';
}
try {
return this._router.isRouteActive(this._router.generate([ routeInQuestion ]));
} catch (ex) {
return false;
}
}
示例2: isCurrentRoute
isCurrentRoute(route){
var instruction = this._router.generate(route);
return this._router.isRouteActive(instruction);
}
示例3: isActive
isActive(instruction: any[]): boolean {
return this._router.isRouteActive(this._router.generate(instruction));
}
示例4: isIndex
isIndex():boolean {
let instruction = this._router.generate(['Index']);
return this._router.isRouteActive(instruction);
}
示例5: isActive
isActive(route) {
return this.router.isRouteActive(this.router.generate(route));
}
示例6: update
private update() {
this.active = this.params && this.router.isRouteActive(this.router.generate(this.params));
}
示例7: constructor
constructor(public router: Router) {
// Do stuff
console.log('ROUTER DEBUG', router, this.router.isRouteActive(this.router.generate(['Home'])));
}
示例8: isRouteActive
// Here's how you determine if a current route is active in ng2
isRouteActive(route: string): boolean {
return this.router.isRouteActive(this.router.generate([route]));
}
示例9: isRouteActive
get isRouteActive(): boolean { return this._router.isRouteActive(this._navigationInstruction); }
示例10: isActive
isActive(instruction: string[]): boolean {
return this._route.isRouteActive(this._route.generate(instruction));
}