Closed jandudulski closed 10 years ago
:+1:
:+1: I do it exactly that way!
I follow that rule already! :+1:
Good :+1: but I prefer:
I'd start with most common ones and end with most specific so :+1: for @jcieslar's version
I'd also make an assignment to make more room for injected dependencies.
App = angular.module('app')
App.controller 'Something', ($scope, Project, $http, user) ->
For more injected dependencies, it is:
App = angular.module('app')
App.controller 'Something', (
$scope, $compile, Service,
Project, $http, user, notes
) ->
And the same as in SLIM: 80 characters hard limit before word wrap
I don't like idea with assignment, but :+1: for @jcieslar version
:+1: for @jcieslar's version - it's easier to distinguish $-services from objects when they are after Capitalized classes
App.controller 'Something', ($scope, $compile, user, Project)
App.controller 'Something', ($scope, $compile, Project, user)
I often see total mess in order how DI params are passed into angular functions. My personal preference is to keep it in such way:
$
prefixSo instead of:
it should be: