I have attempted to implement directives, but they are not functioning correctly. If anyone has a working code for uploading videos with thumbnails, please share it as soon as possible. Thank you in advance.
angular
.module('chotaMangoAdmin')
.directive('fileUpload', fileModel);
fileModel.$inject = [ '$parse' ];
ngThumb.$inject = ['$window'];
function fileModel($parse) {
return {
scope:true, //create a new scope
link: function(scope, element, attrs) {
element.bind('change', function(event){
var files = event.target.files;
console.log(files.length);
scope.$emit("fileSelected", { images: files });
});
}
};
}