Closed maherAshori closed 7 years ago
I handle that by this code
sampleApp .config(["$provide", "$compileProvider", "$controllerProvider", "$filterProvider",
function($provide, $compileProvider, $controllerProvider, $filterProvider) {
sampleApp .controller = $controllerProvider.register;
sampleApp .directive = $compileProvider.register;
sampleApp .filter = $filterProvider.register;
sampleApp .factory = $provide.factory;
sampleApp .service = $provide.service;
sampleApp .constant = $provide.constant;
}
]);
`
app.js
var sampleApp = angular.module("SampleApp", []);
controller.js
sampleApp.controller("Sample.GetController", function ($scope) { var self = this; self.name = "Hello World"; });
when i define controller as above code i get this error:
angular.js:13550 Error: [ng:areq] Argument 'Sample.GetController' is not a function, got undefined
for handle this i use " angular.module("SampleApp").controller()", but my project is so big!, and i want to handle that as easily way if possible.
Thanks