當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript service.RouterService類代碼示例

本文整理匯總了TypeScript中backlive/service.RouterService的典型用法代碼示例。如果您正苦於以下問題:TypeScript RouterService類的具體用法?TypeScript RouterService怎麽用?TypeScript RouterService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了RouterService類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: provideRouter

import {ROUTER_DIRECTIVES, provideRouter} from '@angular/router';
import {RouterService} from 'backlive/service';
import {Route} from './routes';

import {AuthGuard} from './auth.guard';

export const APP_ROUTER_PROVIDERS = [ 
    provideRouter(RouterService.AppRoutes(Route, AuthGuard)),
    AuthGuard
]
開發者ID:urazovm,項目名稱:backlive2.0,代碼行數:10,代碼來源:bootstrap.ts

示例2:

import {Path} from 'backlive/config';

import {DashboardComponent} from './dashboard/dashboard.component';
import {RouteComponentMap} from 'backlive/routes';

/* services */
import {AppService, PopupAlert, RouterService, AuthRouterOutlet, ApiService, UserService} from 'backlive/service';

/* components */
import {BaseComponent, ModalComponent} from 'backlive/component/shared';
import {HeaderNavComponent, SlidingNavComponent, FooterNavComponent} from 'backlive/component/navigation';

/* models */
import {AppEvent, User} from 'backlive/service/model';

RouterService.setRouteMap(RouteComponentMap);

@Component({
    selector: 'backlive-app',
    template: `
      <header class="clearfix">
      	<header-nav></header-nav>
      </header>
      <div id="mainContainer">
          <div class="main clearfix" [class.nav-visible]="isSlidingNavVisible">
              <chart></chart>
              <router-outlet></router-outlet>
          </div>
          <sliding-nav [class.hidden]="!isSlidingNavVisible"></sliding-nav>
      </div>
      <footer>
開發者ID:alincc,項目名稱:backlive2.0,代碼行數:31,代碼來源:test.component.ts

示例3: navigate

 navigate(route: string[]) {
     this.routerService.navigate(route);
 }
開發者ID:alincc,項目名稱:backlive2.0,代碼行數:3,代碼來源:app.component.ts

示例4: getRouteUrl

 getRouteUrl(navItem: NavItem) {
     return this.routerService.getLinkUrl(navItem.route);
 }
開發者ID:urazovm,項目名稱:backlive2.0,代碼行數:3,代碼來源:header-nav.component.ts


注:本文中的backlive/service.RouterService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。