import { RouteConfig, Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router-deprecated';
import { FriendService } from './friends/index';
-import { Search, SearchComponent } from './shared/index';
+import { LoginComponent } from './login/index';
import {
- UserLoginComponent,
AuthService,
- AuthStatus
-} from './users/index';
+ AuthStatus,
+ Search,
+ SearchComponent
+} from './shared/index';
import {
VideoAddComponent,
VideoListComponent,
{
path: '/users/login',
name: 'UserLogin',
- component: UserLoginComponent
+ component: LoginComponent
},
{
path: '/videos/list',
import { Http, Response } from '@angular/http';
import { Observable } from 'rxjs/Rx';
+import { AuthService } from '../shared/index';
+
@Injectable()
export class FriendService {
private static BASE_FRIEND_URL: string = '/api/v1/pods/';
- constructor (private http: Http) {}
+ constructor (private http: Http, private authService: AuthService) {}
makeFriends() {
- return this.http.get(FriendService.BASE_FRIEND_URL + 'makefriends')
+ const headers = this.authService.getRequestHeader();
+ return this.http.get(FriendService.BASE_FRIEND_URL + 'makefriends', { headers })
.map(res => res.status)
.catch(this.handleError);
}
quitFriends() {
- return this.http.get(FriendService.BASE_FRIEND_URL + 'quitfriends')
+ const headers = this.authService.getRequestHeader();
+ return this.http.get(FriendService.BASE_FRIEND_URL + 'quitfriends', { headers })
.map(res => res.status)
.catch(this.handleError);
}
import { AuthService, AuthStatus, User } from '../shared/index';
@Component({
- selector: 'my-user-login',
- styleUrls: [ 'client/app/users/login/login.component.css' ],
- templateUrl: 'client/app/users/login/login.component.html'
+ selector: 'my-login',
+ templateUrl: 'client/app/login/login.component.html'
})
-export class UserLoginComponent {
+export class LoginComponent {
constructor(
private authService: AuthService,
private router: Router
-export * from './search-field.type';
-export * from './search.component';
-export * from './search.model';
+export * from './search/index';
+export * from './users/index'
--- /dev/null
+export * from './search-field.type';
+export * from './search.component';
+export * from './search.model';
@Component({
selector: 'my-search',
- templateUrl: 'client/app/shared/search.component.html',
+ templateUrl: 'client/app/shared/search/search.component.html',
directives: [ DROPDOWN_DIRECTIVES ]
})
+++ /dev/null
-export * from './login/index';
-export * from './shared/index';
import { Pagination } from './pagination.model';
import { Search } from '../../shared/index';
import { SortField } from './sort-field.type';
-import { AuthService } from '../../users/index';
+import { AuthService } from '../../shared/index';
import { Video } from './video.model';
@Injectable()
import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar';
-import { AuthService, User } from '../../users/index';
+import { AuthService, User } from '../../shared/index';
@Component({
selector: 'my-videos-add',
Video,
VideoService
} from '../shared/index';
-import { Search, SearchField } from '../../shared/index';
-import { AuthService, User } from '../../users/index';
+import { AuthService, Search, SearchField, User } from '../../shared/index';
import { VideoMiniatureComponent } from './video-miniature.component';
import { VideoSortComponent } from './video-sort.component';
import { ROUTER_DIRECTIVES } from '@angular/router-deprecated';
import { Video, VideoService } from '../shared/index';
-import { User } from '../../users/index';
+import { User } from '../../shared/index';
@Component({
selector: 'my-video-miniature',
"app/app.component.ts",
"app/friends/friend.service.ts",
"app/friends/index.ts",
+ "app/login/index.ts",
+ "app/login/login.component.ts",
"app/shared/index.ts",
- "app/shared/search-field.type.ts",
- "app/shared/search.component.ts",
- "app/shared/search.model.ts",
- "app/users/index.ts",
- "app/users/login/index.ts",
- "app/users/login/login.component.ts",
- "app/users/shared/auth-status.model.ts",
- "app/users/shared/auth.service.ts",
- "app/users/shared/index.ts",
- "app/users/shared/token.model.ts",
- "app/users/shared/user.model.ts",
+ "app/shared/search/index.ts",
+ "app/shared/search/search-field.type.ts",
+ "app/shared/search/search.component.ts",
+ "app/shared/search/search.model.ts",
+ "app/shared/users/auth-status.model.ts",
+ "app/shared/users/auth.service.ts",
+ "app/shared/users/index.ts",
+ "app/shared/users/token.model.ts",
+ "app/shared/users/user.model.ts",
"app/videos/index.ts",
"app/videos/shared/index.ts",
"app/videos/shared/loader/index.ts",