angularUtils icon indicating copy to clipboard operation
angularUtils copied to clipboard

dirPagination. Unknown provider: angularUtils.directives.dirPaginationProvider

Open Ellebkey opened this issue 7 years ago • 2 comments

Hi, I tried to use dirPagination system on my mean.js project but when I load it in the Angular controller it shows the next error:

Error: [$injector:unpr] Unknown provider: angularUtils.directives.dirPaginationProvider <- angularUtils.directives.dirPagination <- CoursesController

I installed the module with bower and I have the "version": "0.11.1". I added the module to my config and assets files. My Controller is like this:

angular.module('courses').controller('CoursesController', ['$scope', '$stateParams', 
                                                        '$location', 'Authentication', 
                                                        'Courses', 'Rooms', 'Periods',
                                                        'Subjects', 'ngDialog', 'notify',
                                                        'angularUtils.directives.dirPagination',

  function($scope, $stateParams, $location, Authentication, Courses, Rooms, Periods, Subjects, ngDialog, notify) {

Am I adding the wrong way the module, or what else do I have to do?

Ellebkey avatar Mar 05 '17 23:03 Ellebkey

Kindly Check that you are referencing the directive lib in scripts section. After that, Add the directive in the module like this:

angular.module('courses', [ 'angularUtils.directives.dirPagination'])

as I can see your above code, you dont need to define it again in controller once you have defined in module section.So just remove the 'angularUtils.directives.dirPagination' in your controller.

Hope it helps :)

msgadi avatar Mar 06 '17 10:03 msgadi

@mgadirocks Thanks, that worked. If anyone else has the same problem you have to add the module here: /modules/core/client/app/config.js

And you don't have to add it again in your controller.

Ellebkey avatar Mar 06 '17 15:03 Ellebkey