Created
January 5, 2016 15:09
-
-
Save Colex/658e534159027ecfc60b to your computer and use it in GitHub Desktop.
Route Active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, ViewEncapsulation} from 'angular2/core'; | |
import { | |
RouteConfig, | |
ROUTER_DIRECTIVES | |
} from 'angular2/router'; | |
import {StaticPages} from '../staticpages/staticpages'; | |
import {DashboardPage} from '../dashboardpage/dashboardpage'; | |
@Component({ | |
selector: 'app', | |
viewProviders: [NameList], | |
templateUrl: './components/app/app.html', | |
styleUrls: ['./components/app/app.css'], | |
encapsulation: ViewEncapsulation.None, | |
directives: [ROUTER_DIRECTIVES] | |
}) | |
@RouteConfig([ | |
{ path: '/...', component: StaticPages, as: 'StaticPages' }, | |
{ path: '/dashboard/...', component: DashboardPage, as: 'Dashboard' } | |
]) | |
export class AppCmp {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from 'angular2/core'; | |
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router'; | |
import {SideMenu} from '../sidemenu/sidemenu'; | |
import {OverviewPage} from '../overviewpage/overviewpage'; | |
import {Users} from '../../services/users'; | |
@Component({ | |
selector: 'dashboardpage', | |
templateUrl: './components/dashboardpage/dashboardpage.html', | |
directives: [ROUTER_DIRECTIVES, DashboardTopMenu, SideMenu], | |
providers: [Users] | |
}) | |
@RouteConfig([ | |
{ path: '/:username', component: OverviewPage, as: 'Overview' } | |
]) | |
export class DashboardPage {}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment