samedi 17 septembre 2016

Problems with angular file upload rails gem

I am using this angular-file-upload rails gem http://ift.tt/1BtuPzT

But than I connect it to project console returns:

TypeError: FileUploader is not a function

So this is my application.js:

//= require angular
//= require angular-rails-templates
//= require angular-ui-router
//= require angular-ui-bootstrap-tpls
//= require interact
//= require angular-devise
//= require angular-datepicker
//= require moment
//= require moment-timezone
//= require angularjs-file-upload
//= require_tree .

app.js:

angular.module('app', ['ui.router', 'templates', 'Devise', 'datePicker', 'angularFileUpload']).config([
'$stateProvider',
'$urlRouterProvider',
function($stateProvider, $urlRouterProvider) {.......

And controller....

angular.module('app').controller('NewEventCtrl', [
    '$scope',
    'events',
    'Auth',
    'FileUploader',
    function($scope, events, FileUploader){
        $scope.uploader = new FileUploader();

Aucun commentaire:

Enregistrer un commentaire