I'm facing some difficulties with injecting one factory into another.
The error message I'm getting is:
`ReferenceError: testDataService is not defined`
I thought it would be a simple issue to resolve, but it's turning out to be quite challenging. It seems like I'm struggling with the syntax related to dependency injection.
In my main factory, I'm initializing the service call like this :
this.treeGridOptions = gadgetInitService.initTreeGridTEST();
Everything looks good up to this point.
However, the problem arises below in initTreeGridTEST
Here's my implementation of the testDataService factory, which just provides some hard-coded options:
(function () {
'use strict';
angular.module('rage').factory('testDataService', [testData ]);
function testData() {
var service = {
treegridData: treegridData
};
return service;
}
function treegridData() {
return {
"altrows": true,
"sortable": true,
"columnsResize": true,
"editable": true,
"showToolbar": false,
"width": "100%",
"height": 400,
"source": {}
};
}
})();
and here's where 'testDataService' is being injected:
(function () {
'use strict';
angular.module('rage').factory('gadgetInitService', ['testDataService', gridHierarchyService]);
function gridHierarchyService(testDataService) {
var service = {
initTreeGrid: initTreeGrid,
initColumnChart: initColumnChart,
initTreeGridTEST: initTreeGridTEST
}
return service;
}
function initTreeGridTEST() {
var myData = testDataService.treegridData();
return myData;
}
})();
Any help or advice on this matter would be greatly appreciated,
Bob