I'm pretty new to Angular and am looking for some help with basic concepts. At the moment I have one module that has functions and attributes that I would like to access in a separate module.
Here's the code I would like to access:
(function() {
'use strict';
var recentItemRepoDep = [
'repository',
recentItemRepository
];
var repoName = 'spRecentItemRepository';
angular
.module('repository')
.run(repoSelfRegister(repoName))
.factory(repoName, recentItemRepoDep);
function recentItemRepository(repository) {
var repo = repository('APIRecentItem', {
primaryKeys: [/*'UserName',*/ 'ItemID']
});
return repo;
}
})();
And here's the beginning of the code I'm trying to implement the previous code in:
(function() {
'use strict';
var salesDocumentMenuCtrlDep = [
'$scope',
'$state',
'$stateParams',
'repos',
'spTabBarViewModel',
'spLoader',
'spCurrentUser',
'salesDocsVal',
salesDocumentMenuCtrl
];
angular
.module('salesDocumentModule')
.controller('salesDocumentMenuCtrl', salesDocumentMenuCtrlDep);
I'm wondering if there's a way to inject one module into another one but nothing I've tried has worked so far.