0

I'm using Angular directive to file upload, but I need to add a progress bar to html view to weather image is uploaded to form or not.

geniusPos.directive('fileModel', ['$parse', function ($parse) {
    return {
        restrict: 'A',
        link: function(scope, element, attrs) {
            var model = $parse(attrs.fileModel);
            var modelSetter = model.assign;`

            element.bind('change', function(){
                scope.$apply(function(){
                    `modelSetter(scope, element[0].files[0]);`
                });
            });
        }
    };
}]); 
George Kagan
  • 5,913
  • 8
  • 46
  • 50
Ipula
  • 51
  • 10

0 Answers0