if (event.keyCode === 13) {
// Check if the tag is valid and does not already exist
if (
- currentTag !== '' &&
+ currentTag.length >= 2 &&
this.form.controls['currentTag'].valid &&
this.tags.indexOf(currentTag) === -1
) {
// TODO: wait for https://github.com/valor-software/ng2-file-upload/pull/242
item.alias = 'videofile';
+ // FIXME: remove
+ // Run detection change for progress bar
+ const interval = setInterval(() => { ; }, 250);
+
item.onSuccess = () => {
+ clearInterval(interval);
+
console.log('Video uploaded.');
// Print all the videos once it's finished
};
item.onError = (response: string, status: number) => {
+ clearInterval(interval);
+
// We need to handle manually these cases beceause we use the FileUpload component
if (status === 400) {
this.error = response;
}
};
-
this.uploader.uploadAll();
}
}