本文整理汇总了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);
}