当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Router.isRouteActive方法代码示例

本文整理汇总了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;
        }
    }
开发者ID:dwalldorf,项目名称:owTracker,代码行数:19,代码来源:navigation.service.ts

示例2: isCurrentRoute

 isCurrentRoute(route){
   var instruction = this._router.generate(route);
   return this._router.isRouteActive(instruction);
 }
开发者ID:olivierl,项目名称:angular2-project,代码行数:4,代码来源:navbar.component.ts

示例3: isActive

	isActive(instruction: any[]): boolean {
		return this._router.isRouteActive(this._router.generate(instruction));
	}
开发者ID:ChildeRowland,项目名称:angular2-social-media,代码行数:3,代码来源:navbar.component.ts

示例4: isIndex

 isIndex():boolean {
   let instruction = this._router.generate(['Index']);
   return this._router.isRouteActive(instruction);
 }
开发者ID:AlmeroSteyn,项目名称:cb-a11y-bootstrap,代码行数:4,代码来源:app.component.ts

示例5: isActive

	isActive(route) {
		return this.router.isRouteActive(this.router.generate(route));
	}
开发者ID:djulls07,项目名称:projects-manager,代码行数:3,代码来源:navbar.ts

示例6: update

 private update() {
   this.active = this.params && this.router.isRouteActive(this.router.generate(this.params));
 }
开发者ID:Arteaga2k,项目名称:Preserver,代码行数:3,代码来源:route-active.ts

示例7: constructor

 constructor(public router: Router) {
   // Do stuff
   console.log('ROUTER DEBUG', router, this.router.isRouteActive(this.router.generate(['Home'])));
 }
开发者ID:ArchitectingSoftware,项目名称:t7-behavioral,代码行数:4,代码来源:home.component.ts

示例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]));
 }
开发者ID:GerbenRampaart,项目名称:ngbook2,代码行数:4,代码来源:sidebar.ts

示例9: isRouteActive

 get isRouteActive(): boolean { return this._router.isRouteActive(this._navigationInstruction); }
开发者ID:AndreasLoukakis,项目名称:nativescript-angular,代码行数:1,代码来源:ns-router-link.ts

示例10: isActive

 isActive(instruction: string[]): boolean {
   return this._route.isRouteActive(this._route.generate(instruction));
 }
开发者ID:JayKan,项目名称:angular2-dashboard,代码行数:3,代码来源:side-nav.component.ts


注:本文中的@angular/router-deprecated.Router.isRouteActive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。