Created
May 22, 2013 14:05
-
-
Save kadamwhite/5627762 to your computer and use it in GitHub Desktop.
AngularJS Declaration Conventions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.directive('myDirective', [ | |
'$compile', | |
'$location', | |
'Notify', | |
'sharedData', | |
function($compile, $location, Notify, sharedData) { | |
// do stuff | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.directive('myDirective', [ | |
'$location', | |
'$compile', | |
'Notify', | |
'sharedData', | |
function($location, $compile, Notify, sharedData) { | |
// do stuff | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.directive('myDirective', [ | |
'$compile', | |
'$location', | |
'Notify', | |
'sharedData', | |
function( | |
$compile, | |
$location, | |
Notify, | |
sharedData | |
) { | |
// do stuff | |
} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.directive('myDirective', ['$location', '$compile', 'Notify', 'sharedData', function($location, $compile, Notify, sharedData) { | |
// do stuff | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.directive('myDirective', ['$location', '$compile', 'Notify', 'sharedData', | |
function($location, $compile, Notify, sharedData) { | |
// do stuff | |
} | |
); |
Yeah when I run sort-lines in my editor the angular modules bubble to the top because of the $ symbol.
Note that for most controllers this will result in $scope
not coming first. This is acceptable.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The angular-first came for free b/c I was assuming symbols preceded letters—I'm fine either way. Adam and Jason seem to be on-board with either multi-line everything or multi-line alpha.