I
I
Ivan Kondratiev2015-06-08 12:36:48
Angular
Ivan Kondratiev, 2015-06-08 12:36:48

What is the error when initializing angularFileUpload?

Hello. I continue to learn angular. I can not deal with the file uploader to the server.
here is the input:

<input type="file" id="slider_photo" name="slider[photo]" required="required" class="form-control" nv-file-select="" uploader="uploader">

js
var adminControllers = angular.module('adminControllers',['angularFileUpload']);


adminControllers.controller('AddPageCtrl',['$scope', '$http', '$route', '$location', '$templateCache' , 'FileUploader',
    function($scope, $http,$route,$location, $templateCache, FileUploader){

        var uploader = $scope.uploader = new FileUploader({
            url: 'upload.php'
        });

    }
]);

Such an error flies out
prntscr.com/7ehbv3
What could be the matter?
Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Tartmin, 2015-06-08
@baskerville42

var uploader = $scope.uploader = new FileUploader({
            url: 'upload.php'
        });

Remove the variable, and the scope is enough for you.

I
Ivan Kondratiev, 2015-06-08
@inik23

Used this solution if anyone is interested

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question