From ab32b0fc805b92c5a1d7ac5901cb1a38e94622ca Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 6 Sep 2016 22:40:57 +0200 Subject: Dirty update to Angular RC6 --- client/src/app/videos/video-add/video-add.component.ts | 11 +++-------- client/src/app/videos/video-list/video-list.component.ts | 12 ++---------- .../src/app/videos/video-list/video-miniature.component.ts | 6 +----- client/src/app/videos/video-watch/video-watch.component.ts | 9 ++------- client/src/app/videos/videos.component.ts | 4 +--- client/src/app/videos/videos.routes.ts | 4 ++-- 6 files changed, 11 insertions(+), 35 deletions(-) (limited to 'client/src/app/videos') diff --git a/client/src/app/videos/video-add/video-add.component.ts b/client/src/app/videos/video-add/video-add.component.ts index 900ef1da3..f0695d768 100644 --- a/client/src/app/videos/video-add/video-add.component.ts +++ b/client/src/app/videos/video-add/video-add.component.ts @@ -1,20 +1,15 @@ -import { Validators } from '@angular/common'; import { Component, ElementRef, OnInit } from '@angular/core'; -import { FormControl, FormGroup, REACTIVE_FORM_DIRECTIVES } from '@angular/forms'; +import { FormControl, FormGroup, Validators } from '@angular/forms'; import { Router } from '@angular/router'; -import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; -import { PROGRESSBAR_DIRECTIVES } from 'ng2-bootstrap/components/progressbar'; -import { FileSelectDirective, FileUploader } from 'ng2-file-upload/ng2-file-upload'; +import { FileUploader } from 'ng2-file-upload/ng2-file-upload'; import { AuthService } from '../../shared'; @Component({ selector: 'my-videos-add', styles: [ require('./video-add.component.scss') ], - template: require('./video-add.component.html'), - directives: [ FileSelectDirective, PROGRESSBAR_DIRECTIVES, REACTIVE_FORM_DIRECTIVES ], - pipes: [ BytesPipe ] + template: require('./video-add.component.html') }) export class VideoAddComponent implements OnInit { diff --git a/client/src/app/videos/video-list/video-list.component.ts b/client/src/app/videos/video-list/video-list.component.ts index 9a9ffe29f..fa8e497aa 100644 --- a/client/src/app/videos/video-list/video-list.component.ts +++ b/client/src/app/videos/video-list/video-list.component.ts @@ -1,27 +1,19 @@ import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core'; -import { AsyncPipe } from '@angular/common'; -import { ActivatedRoute, Router, ROUTER_DIRECTIVES } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; -import { PAGINATION_DIRECTIVES } from 'ng2-bootstrap/components/pagination'; - import { - LoaderComponent, SortField, Video, VideoService } from '../shared'; import { AuthService, AuthUser, RestPagination, Search, SearchField } from '../../shared'; -import { VideoMiniatureComponent } from './video-miniature.component'; -import { VideoSortComponent } from './video-sort.component'; import { SearchService } from '../../shared'; @Component({ selector: 'my-videos-list', styles: [ require('./video-list.component.scss') ], - pipes: [ AsyncPipe ], - template: require('./video-list.component.html'), - directives: [ LoaderComponent, PAGINATION_DIRECTIVES, ROUTER_DIRECTIVES, VideoMiniatureComponent, VideoSortComponent ] + template: require('./video-list.component.html') }) export class VideoListComponent implements OnInit, OnDestroy { diff --git a/client/src/app/videos/video-list/video-miniature.component.ts b/client/src/app/videos/video-list/video-miniature.component.ts index 84bab950e..38317f832 100644 --- a/client/src/app/videos/video-list/video-miniature.component.ts +++ b/client/src/app/videos/video-list/video-miniature.component.ts @@ -1,6 +1,4 @@ -import { DatePipe } from '@angular/common'; import { Component, Input, Output, EventEmitter } from '@angular/core'; -import { ROUTER_DIRECTIVES } from '@angular/router'; import { SortField, Video, VideoService } from '../shared'; import { User } from '../../shared'; @@ -8,9 +6,7 @@ import { User } from '../../shared'; @Component({ selector: 'my-video-miniature', styles: [ require('./video-miniature.component.scss') ], - template: require('./video-miniature.component.html'), - directives: [ ROUTER_DIRECTIVES ], - pipes: [ DatePipe ] + template: require('./video-miniature.component.html') }) export class VideoMiniatureComponent { diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts index d260e55c7..2a60e9327 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts @@ -1,18 +1,13 @@ import { Component, ElementRef, NgZone, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; - -import { LoaderComponent, Video, VideoService } from '../shared'; +import { Video, VideoService } from '../shared'; import { WebTorrentService } from './webtorrent.service'; @Component({ selector: 'my-video-watch', template: require('./video-watch.component.html'), - styles: [ require('./video-watch.component.scss') ], - providers: [ WebTorrentService ], - directives: [ LoaderComponent ], - pipes: [ BytesPipe ] + styles: [ require('./video-watch.component.scss') ] }) export class VideoWatchComponent implements OnInit, OnDestroy { diff --git a/client/src/app/videos/videos.component.ts b/client/src/app/videos/videos.component.ts index 76252afbb..591e7523d 100644 --- a/client/src/app/videos/videos.component.ts +++ b/client/src/app/videos/videos.component.ts @@ -1,9 +1,7 @@ import { Component } from '@angular/core'; -import { ROUTER_DIRECTIVES } from '@angular/router'; @Component({ - template: '', - directives: [ ROUTER_DIRECTIVES ] + template: '' }) export class VideosComponent { diff --git a/client/src/app/videos/videos.routes.ts b/client/src/app/videos/videos.routes.ts index 1f088b376..074f96596 100644 --- a/client/src/app/videos/videos.routes.ts +++ b/client/src/app/videos/videos.routes.ts @@ -1,11 +1,11 @@ -import { RouterConfig } from '@angular/router'; +import { Routes } from '@angular/router'; import { VideoAddComponent } from './video-add'; import { VideoListComponent } from './video-list'; import { VideosComponent } from './videos.component'; import { VideoWatchComponent } from './video-watch'; -export const VideosRoutes: RouterConfig = [ +export const VideosRoutes: Routes = [ { path: 'videos', component: VideosComponent, -- cgit v1.2.3