Angular Ng file Upload Model : Abort function is not working
<p>Am using the following module <a href="https://github.com/danialfarid/ng-file-upload" rel="nofollow">https://github.com/danialfarid/ng-file-upload</a> and it has well documented except for aborting the upload process.  During uploading the files, The code for <strong>cancel the upload</strong> is not working fine. 
Am getting error that says 'abort is not a function' and I do not know how to apply the abort() function to cancel the upload process. </p>

<p>I dont know what i missed here, Could anyone give me some idea on why? or any suggestion please.</p>

<p>My html</p>

<pre><code>&lt;body ng-app="fileUpload" ng-controller="MyCtrl"&gt;
     &lt;h4&gt;Upload on file select&lt;/h4&gt;

    &lt;button ngf-select="uploadFiles($files)" multiple 
            accept="image/*,audio/*,video/*"&gt;Select Files&lt;/button&gt;

    &lt;span class="progress" ng-show="progress &gt;= 0"&gt;
        &lt;div style="width:{{progress}}%" ng-bind="progress + '%'"&gt;&lt;/div&gt;
    &lt;/span&gt;
    {{errorMsg}}

    &lt;button ng-click="cancelUpload()"&gt;Cancel&lt;/button&gt;

&lt;/body&gt;
</code></pre>

<p>JS(Angular)</p>

<pre><code>var app = angular.module('fileUpload', ['ngFileUpload']);

app.controller('MyCtrl', ['$scope', 'Upload', '$timeout', function ($scope, Upload, $timeout) {

var upload = "";

    $scope.uploadFiles = function (files) {
        $scope.files = files;
        if (files &amp;&amp; files.length) {
            upload = Upload.upload({
                url: 'https://angular-file-upload-cors-srv.appspot.com/upload',
                data: {
                    files: files
                },
                resumeSize: function() {return promise;}
            }).then(function (response) {
                $timeout(function () {
                    $scope.result = response.data;
                });
            }, function (response) {
                if (response.status &gt; 0) {
                    $scope.errorMsg = response.status + ': ' + response.data;
                }
            }, function (evt) {
                $scope.progress = 
                    Math.min(100, parseInt(100.0 * evt.loaded / evt.total));
            });
        }
    };


    $scope.cancelUpload = function(files){   // here is my cancel program
    console.log("Cancelling");
     upload.abort();              // this 'abort()' is not working as mentined
    }
</code></pre>