Created
February 3, 2014 23:46
-
-
Save zekesonxx/8794796 to your computer and use it in GitHub Desktop.
Why I hate Angular and indenting
This file contains 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
if (true) { | |
"This makes sense, because the } closes the if" | |
} | |
command.function(1, 4, function() { | |
"This also makes sense, because it is a async callback" | |
}); | |
angular.hasStupidPatterns('CtrlThis', ['$scope', '$http', function($scope, $http) { | |
"This looks ugly" | |
}]); | |
angular.hasStupidPatterns('CtrlThis', ['$scope', '$http', | |
function($scope, $http) { | |
"This also looks ugly" | |
}]); | |
angular.hasStupidPatterns('CtrlThis', ['$scope', '$http', | |
function($scope, $http) { | |
"This looks the best out of the possible solutions" | |
}]); |
So follow this pattern
angular
.module('app.module')
.controller('Ctrl', Ctrl);
Ctrl.$inject = ['$scope', '$http'];
/* @ngInject */
function Ctrl($scope, $http) {
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have the same feeling. They made Dependency Injection their trademark, but did it in very messy way. There are couple of cool features which you can do with vanilla, maybe jquery, maybe watchjs. Rest are inflexible assumptions that block you from doing anything bigger.