diff options
Diffstat (limited to 'client/angular/videos/components/add')
-rw-r--r-- | client/angular/videos/components/add/videos-add.component.ts | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/client/angular/videos/components/add/videos-add.component.ts b/client/angular/videos/components/add/videos-add.component.ts index 97e3bb3b5..8ff6cfec8 100644 --- a/client/angular/videos/components/add/videos-add.component.ts +++ b/client/angular/videos/components/add/videos-add.component.ts | |||
@@ -1,9 +1,10 @@ | |||
1 | import {Component, ElementRef, Inject, OnInit} from 'angular2/core'; | 1 | import { Component, ElementRef, Inject, OnInit } from 'angular2/core'; |
2 | import {Router} from 'angular2/router'; | 2 | import { Router } from 'angular2/router'; |
3 | import {NgForm} from 'angular2/common'; | 3 | import { NgForm } from 'angular2/common'; |
4 | 4 | ||
5 | import {Video} from '../../models/video'; | 5 | import { Video } from '../../models/video'; |
6 | 6 | ||
7 | // TODO: import it with systemjs | ||
7 | declare var jQuery:any; | 8 | declare var jQuery:any; |
8 | 9 | ||
9 | @Component({ | 10 | @Component({ |
@@ -22,9 +23,10 @@ export class VideosAddComponent implements OnInit { | |||
22 | 23 | ||
23 | ngOnInit() { | 24 | ngOnInit() { |
24 | jQuery(this._elementRef.nativeElement).find('#input_video').fileupload({ | 25 | jQuery(this._elementRef.nativeElement).find('#input_video').fileupload({ |
26 | url: '/api/v1/videos', | ||
27 | dataType: 'json', | ||
25 | singleFileUploads: true, | 28 | singleFileUploads: true, |
26 | multipart: true, | 29 | multipart: true, |
27 | url: '/api/v1/videos', | ||
28 | autoupload: false, | 30 | autoupload: false, |
29 | 31 | ||
30 | add: (e, data) => { | 32 | add: (e, data) => { |
@@ -38,7 +40,8 @@ export class VideosAddComponent implements OnInit { | |||
38 | }, | 40 | }, |
39 | 41 | ||
40 | done: (e, data) => { | 42 | done: (e, data) => { |
41 | console.log('finished'); | 43 | console.log('Video uploaded.'); |
44 | |||
42 | // Print all the videos once it's finished | 45 | // Print all the videos once it's finished |
43 | this._router.navigate(['VideosList']); | 46 | this._router.navigate(['VideosList']); |
44 | } | 47 | } |