diff options
Diffstat (limited to 'client/src/app/app.component.ts')
-rw-r--r-- | client/src/app/app.component.ts | 40 |
1 files changed, 6 insertions, 34 deletions
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts index 0cee6edbf..88b181f9c 100644 --- a/client/src/app/app.component.ts +++ b/client/src/app/app.component.ts | |||
@@ -1,52 +1,23 @@ | |||
1 | import { Component } from '@angular/core'; | 1 | import { Component } from '@angular/core'; |
2 | import { HTTP_PROVIDERS } from '@angular/http'; | 2 | import { HTTP_PROVIDERS } from '@angular/http'; |
3 | import { Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, Routes } from '@angular/router'; | 3 | import { Router, ROUTER_DIRECTIVES } from '@angular/router'; |
4 | 4 | ||
5 | import { FriendService } from './friends'; | 5 | import { FriendService } from './friends'; |
6 | import { LoginComponent } from './login'; | ||
7 | import { | 6 | import { |
8 | AuthService, | 7 | AuthService, |
9 | AuthStatus, | 8 | AuthStatus, |
10 | Search, | 9 | Search, |
11 | SearchComponent | 10 | SearchComponent, |
11 | SearchService | ||
12 | } from './shared'; | 12 | } from './shared'; |
13 | import { | 13 | import { VideoService } from './videos'; |
14 | VideoAddComponent, | ||
15 | VideoListComponent, | ||
16 | VideoWatchComponent, | ||
17 | VideoService | ||
18 | } from './videos'; | ||
19 | import { SearchService } from './shared'; // Temporary | ||
20 | |||
21 | @Routes([ | ||
22 | { | ||
23 | path: '/users/login', | ||
24 | component: LoginComponent | ||
25 | }, | ||
26 | { | ||
27 | path: '/videos/list', | ||
28 | component: VideoListComponent | ||
29 | }, | ||
30 | { | ||
31 | path: '/videos/watch/:id', | ||
32 | component: VideoWatchComponent | ||
33 | }, | ||
34 | { | ||
35 | path: '/videos/add', | ||
36 | component: VideoAddComponent | ||
37 | }, | ||
38 | { | ||
39 | path: '/', | ||
40 | component: VideoListComponent | ||
41 | } | ||
42 | ]) | ||
43 | 14 | ||
44 | @Component({ | 15 | @Component({ |
45 | selector: 'my-app', | 16 | selector: 'my-app', |
46 | template: require('./app.component.html'), | 17 | template: require('./app.component.html'), |
47 | styles: [ require('./app.component.scss') ], | 18 | styles: [ require('./app.component.scss') ], |
48 | directives: [ ROUTER_DIRECTIVES, SearchComponent ], | 19 | directives: [ ROUTER_DIRECTIVES, SearchComponent ], |
49 | providers: [ AuthService, FriendService, HTTP_PROVIDERS, ROUTER_PROVIDERS, VideoService, SearchService ] | 20 | providers: [ AuthService, FriendService, HTTP_PROVIDERS, VideoService, SearchService ] |
50 | }) | 21 | }) |
51 | 22 | ||
52 | export class AppComponent { | 23 | export class AppComponent { |
@@ -75,6 +46,7 @@ export class AppComponent { | |||
75 | field: search.field, | 46 | field: search.field, |
76 | search: search.value | 47 | search: search.value |
77 | }; | 48 | }; |
49 | |||
78 | this.router.navigate(['/videos/list', params]); | 50 | this.router.navigate(['/videos/list', params]); |
79 | } else { | 51 | } else { |
80 | this.router.navigate(['/videos/list']); | 52 | this.router.navigate(['/videos/list']); |