angularjs - How to install an Angular Directive in meanJS -
i've been trying install angular directive in meanjs folderstructure. i'm getting error when trying add directive controller.
error: [$injector:unpr] unknown provider: duscrollprovider <- duscroll <- homecontroller http://errors.angularjs.org/1.3.20/$injector/unpr?p0=duscrollprovider%20%3c-nanuscroll%20%3c-%20homecontroller @ http://localhost:3000/lib/angular/angular.js:63:12 @ http://localhost:3000/lib/angular/angular.js:4031:19 @ object.getservice [as get] (http://localhost:3000/lib/angular/angular.js:4178:39) @ http://localhost:3000/lib/angular/angular.js:4036:45 @ getservice (http://localhost:3000/lib/angular/angular.js:4178:39) @ object.invoke (http://localhost:3000/lib/angular/angular.js:4210:13) @ extend.instance (http://localhost:3000/lib/angular/angular.js:8516:21) @ http://localhost:3000/lib/angular/angular.js:7762:13 @ foreach (http://localhost:3000/lib/angular/angular.js:334:20) @ nodelinkfn (http://localhost:3000/lib/angular/angular.js:7761:11)
the directive i'm trying install is: https://github.com/oblador/angular-scroll
i'm on version 0.4.2
however i've tried other "scroll" directives same error.
i'm trying add in home.client.controller.js so:
angular.module('core').controller('homecontroller', ['$scope', 'authentication', 'duscroll', function ($scope, authentication, duscroll) {
i've tried adding end of core.
angular.module('core', ['duscroll']).controller('homecontroller', ['$scope', 'authentication', function ($scope, authentication) {
as answer below tried well.
i added 'public/lib/angular-scroll/angular-scroll.js'
default.js file located in config/assets/default.js
and added duscroll in config.js located in: modules/core/client/app/config.js
var applicationmodulevendordependencies = ['ngresource', 'nganimate', 'ngmessages', 'ui.router', 'ui.bootstrap', 'ui.utils', 'angularfileupload', 'duscroll'];
however i'm still getting same error.
all documentation says should use bower install or npm install install these directives. since it's modular folder structure have no idea how recognize directive. i've tried including it, in of places think of might work.
any figuring out how install directive in meanjs folder structure appreciated!
thanks
i gave answer similar question here.
if you're using version 0.3.3 have update
config/env/all.js
file place path dependency file , in case angular 3rd party module have inject in main angular module can done in filepublic/config.js
.if you're using version 0.4.2 have update
config/assets/default.js
file place path dependency file , in case angular 3rd party module have inject in main angular module can done in filemodules/core/client/app/config.js
.
Comments
Post a Comment