sweeten your
coffeescript
View GitHub Repo
# Wrap functions with `di()` to create $inject-style arrays. app.controller "SomeController", di ($scope, $http) -> $http.get('/some.json'); # Function references can be used--just use `di()` when # defining the function (instead of at the call site). runBlock = di ($injector, $rootScope) -> $injector.invoke di ($controller) -> $controller('SomeController', $scope: $rootScope.$new()) app.run runBlock # `di()` can be used anywhere; it doesn't depend on "passes"... app.config di ($routeProvider) -> $routeProvider .when '/', templateUrl: 'root.html' resolve: currentUser: di (userService) -> userService.getCurrentUser() # ...or detection of Angular modules. ds.module('desk.agent.case') .run di ( $q DsEvent DsI18n ) -> # ... ds.module('ds.shortcuts') .config di (DsConfig, $provide)-> # ... $set: di ($dsModule) -> # ... $get: di ($dsModule, _$injector_, _$log_) -> # ... $getScope: di ($dsModule, $scope) -> # ... .config di (DsShortcutProvider) -> DsShortcutProvider.$$setShortcutFilter di ($state, $namespace) -> # ...