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"
}]);
@sielay
Copy link

sielay commented Sep 17, 2014

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.

@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