angular/angular.js — pull request #7080 by caitp (2014-04-11 00:29:56+00:00)
Title: feat(injector): "strict-DI" mode which disables "automatic" function annotation

This modifies the injector to prevent automatic annotation from occurring for
a given injector.

This behaviour can be enabled when bootstrapping the application by using the
attribute
"ng-strict-di" on the root element (the element containing "ng-app"), or
alternatively by passing an object with the property "strictDi" set to "true"
in angular.bootstrap, when bootstrapping manually.

JS example:

angular.module("name", ["dependencies", "otherdeps"])
.provider("$willBreak", function() {
this.$get = function($rootScope) {
};
})
.run(["$willBreak", function($willBreak) {
// This block will never run because the noMagic flag was set to true,
// and the $willBreak '$get' function does not have an explicit
// annotation.
}]);

angular.bootstrap(document, ["name"], {
strictDi: true
});

HTML:

This will only affect functions with an arity greater than 0, and without an
$inject property.

Closes #6719 Closes #6717 Closes #4504 Closes #6069 Closes #3611