-import { Component, ElementRef } from 'angular2/core';
-import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from 'angular2/router';
-import { HTTP_PROVIDERS } from 'angular2/http';
+import { Component } from '@angular/core';
+import { RouteConfig, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Router } from '@angular/router-deprecated';
+import { HTTP_PROVIDERS } from '@angular/http';
import { VideosAddComponent } from '../videos/components/add/videos-add.component';
import { VideosListComponent } from '../videos/components/list/videos-list.component';
templateUrl: 'app/angular/app/app.component.html',
styleUrls: [ 'app/angular/app/app.component.css' ],
directives: [ ROUTER_DIRECTIVES ],
- providers: [ ROUTER_PROVIDERS, HTTP_PROVIDERS,
- ElementRef, VideosService, FriendsService,
- AuthService
- ]
+ providers: [ ROUTER_PROVIDERS, HTTP_PROVIDERS, VideosService, FriendsService, AuthService ]
})
export class AppComponent {
private _authService: AuthService,
private _router: Router
) {
- if (localStorage.getItem('access_token')) this.isLoggedIn = true;
- else this.isLoggedIn = false;
+ this.isLoggedIn = this._authService.isLoggedIn();
this._authService.loginChanged$.subscribe(
status => {
}
},
error => alert(error)
- )
+ );
}
quitFriends() {
alert('Quit friends!');
},
error => alert(error)
- )
+ );
}
}