diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-03-14 22:16:43 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-03-14 22:16:43 +0100 |
commit | 98b01bac2c2c4536aa97d826b61516657f4d15f5 (patch) | |
tree | 75fe2d75f1c58c6897127f03cfb7d8b654545227 /client/angular/videos/components/add | |
parent | dc8bc31be517a53e8fbe7100cfe45cd73f596de0 (diff) | |
download | PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.gz PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.tar.zst PeerTube-98b01bac2c2c4536aa97d826b61516657f4d15f5.zip |
Angular 2 : draft 2
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 | } |