News for hackers. Stuff that matters.
Re:Converting an existing Backbone.js project to Require.js by altcognito on Sunday August 25, 2013 @02:12PM (#6272976)
Hrm.... I don't think the angular documentation agrees with what you are saying: In the documentation on the $inject annotation:

> Care must be taken that the $inject annotation is kept in sync with the actual arguments in the function declaration.

> This method of annotation is useful for controller declarations since it assigns the annotation information with the function.

Re:Converting an existing Backbone.js project to Require.js by mbell on Sunday August 25, 2013 @02:25PM (#6273034)
You don't need to use angular's inline injection annotations if you don't want to. Angular can figure out the needed injection by the parameter name. This causes an issue when you minimize your code but ngmin solves that problem: https://github.com/btford/ngmin

For example:

    angular.module('app').controller('someController', function ($scope, ModelService, AuthService) {
      $scope.something = 'Blah';
    });
Works just fine as long as it isn't minimized, and ngmin would turn it into something like:

    angular.module('app').controller('someController', ['$scope', 'ModelService', 'AuthService', function ($scope, ModelService, AuthService) {
      $scope.something = 'Blah';
    }]);
Which is then safe to run through a minimizer.
Re:Converting an existing Backbone.js project to Require.js by CoffeeDregs on Sunday August 25, 2013 @02:28PM (#6273055)
Agreed, there are corner cases in which Angular has the same issue (hence my note that Angular does better). This is really only an issue when seriously minifying (e.g. closure compiler) your application code and I tend to stay away from that.