本文整理匯總了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
]
示例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>
示例3: navigate
navigate(route: string[]) {
this.routerService.navigate(route);
}
示例4: getRouteUrl
getRouteUrl(navItem: NavItem) {
return this.routerService.getLinkUrl(navItem.route);
}