Created
June 25, 2016 08:37
-
-
Save sonicoder86/0c4027882bf4039eab6590c875b7bb2b to your computer and use it in GitHub Desktop.
Authentication in Angular 2 - part 1
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
// app.component.ts | |
import { Component } from '@angular/core'; | |
import { RouteConfig, RouterOutlet } from '@angular/router-deprecated'; | |
import { HomeComponent } from './home.component'; | |
import { LoginComponent } from './login.component'; | |
import { ProfileComponent } from './profile.component'; | |
@Component({ | |
selector: 'auth-app', | |
directives: [RouterOutlet], | |
template: ` | |
<div class="container body-container"> | |
<router-outlet></router-outlet> | |
</div> | |
` | |
}) | |
@RouteConfig([ | |
{ path: '/', component: HomeComponent, name: 'Home', useAsDefault: true }, | |
{ path: '/login', component: LoginComponent, name: 'Login' }, | |
{ path: '/profile', component: ProfileComponent, name: 'Profile' } | |
]) | |
export class AppComponent {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment