1 import { Component } from '@angular/core';
2 import { HTTP_PROVIDERS } from '@angular/http';
3 import { ActivatedRoute, Router, ROUTER_DIRECTIVES } from '@angular/router';
5 import { FriendService } from './friends';
12 import { VideoService } from './videos';
16 template: require('./app.component.html'),
17 styles: [ require('./app.component.scss') ],
18 directives: [ ROUTER_DIRECTIVES, SearchComponent ],
19 providers: [ AuthService, FriendService, HTTP_PROVIDERS, VideoService, SearchService ]
22 export class AppComponent {
27 private authService: AuthService,
28 private friendService: FriendService,
29 private route: ActivatedRoute,
30 private router: Router
32 this.isLoggedIn = this.authService.isLoggedIn();
34 this.authService.loginChangedSource.subscribe(
36 if (status === AuthStatus.LoggedIn) {
37 this.isLoggedIn = true;
45 // this._authService.logout();
49 this.friendService.makeFriends().subscribe(
52 alert('Already made friends!');
54 alert('Made friends!');
62 this.friendService.quitFriends().subscribe(
64 alert('Quit friends!');