當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。