Skip to content

Instantly share code, notes, and snippets.

@zekesonxx
Created February 3, 2014 23:46
Show Gist options
  • Save zekesonxx/8794796 to your computer and use it in GitHub Desktop.
Save zekesonxx/8794796 to your computer and use it in GitHub Desktop.
Why I hate Angular and indenting
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"
}]);
@LulzAugusto
Copy link

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