$scope value in controller is not identified by AngularJS directive

55 Views Asked by At

I am trying to use Dropzone module for AngularJs and I have problem applying it to my own code. The module has been defined here but there is no documentation on its usage. Here is what I am doing:

Step 1: Injecting ngDropzone to my module:

define([
  'angular',
  './services/index',
  './controllers/index',
  'angular-ui-router',
  'angular-animate',
  'Angular-Dropzone
  ], function (angular, services, controllers) {
     'use strict';

     var app = angular.module('appName', ['ui.router', 'ngAnimate', 'ngDropzone']);

     return app;
  });

Step 2: Seting dropzoneConfig in controller scope

define([
  'angular',
  '../module',
], function (angular, controllers) {
'use strict';

return {
    name: "uploadcontroller",
    controller: ['$scope', '$interval', '$rootScope',
        function ($scope, $interval, $rootScope) {

            $scope.dropzoneConfig = {
                'options': {
                    'url': '/fileupload'
                }
            };
        }
    ]
};
});

Step 3: Inserting directive to html

<ng-dropzone></ng-dropzone>

After running my app I receive the following error:

Error: No URL provided.
0

There are 0 best solutions below