(function () {
'use strict';
angular.module('app')
.controller('someController', ['$scope','localStorageService',someController])
.directive('someDirective', someDirective)
function someController($scope, localStorageService){
$scope.data = {
variable: localStorageService.get('someVar'),
};
console.log("The value of 'someVar' is: " + $scope.data.variable);//outputs correct value
}
function someDirective(){
return {
template: {{data.variable}}
};
}
})();
After adding the following HTML:
<div ng-controller="someController">
<div some-directive></div>
</div>
I am facing an issue where I receive an error message saying "Argument 'someController' is not a function, got undefined" even though someController runs successfully when logging to the console.