Answer the question
In order to leave comments, you need to log in
Why can't pass app.js as a module dependency(requireJS)?
Hello!
My application is in angularJS, the dependencies are described in requireJS, it was not written by me, I just received it a few days ago and said understand it
. I want to create a directive for the main application module, aka app.js
The app.js module is already connected to requireJS, the path to it paths, application controllers freely use app.js as a dependency, but I get undefined when I call a directive on a module.
Directive code:
define(['app'], function(app) {
app.directive('focus', function() {
return {
link: function($scope, element, attrs){
console.log('test')
}
}
});
});
paths: {
app: '../app/app',
...
settingsCtrl: '../app/trend/settings/settings',
...
focus: '../common/directives/focus/focus',
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question