|
|
|
|
|
by bsaul
4696 days ago
|
|
Dependency Injection can really be done in a dark magic way (the java / spring way), but after reading the source code, i can tell you angular.js way of doing it is really not that dark. More importantly, is extremely easy to use. No .xml file, no configuration file, just put the service in that function signature, done (unless you want to minifiy, which means you'll also have to add it as a string right next to it). |
|
app.controller('Name', function(require) { var $scope = require('$scope'); var y = require('some-service'); });
And suddenly, no problems and no weird syntax!