This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Option to disable inferred dependencies #3611
Labels
Milestone
Comments
I always write the code with inferred dependencies, and then use ngmin (https://github.com/btford/ngmin) no prepare it for minification. Would that help you? |
I'll check it out and let you know. Looks promising though. Thanks! |
The seems usable but is still not as reliable as being able to disable inferred dependencies. |
This is definitely something to discuss and may have benefits for tooling. (Triaged to post 1.2; feature) |
Great, thanks. Since creating this issue we've again had a problem with minified code which was overlooked during development. |
+1 for this feature, it would be very useful. |
I think there's good reason to remove them entirely, honestly. |
This will be fixed shortly |
caitp
added a commit
to caitp/angular.js
that referenced
this issue
Apr 11, 2014
…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: <html ng-app="name" ng-strict-di> <!-- ... --> </html> This will only affect functions with an arity greater than 0, and without an $inject property. Closes angular#6719 Closes angular#6717 Closes angular#4504 Closes angular#6069 Closes angular#3611
caitp
added a commit
that referenced
this issue
Apr 11, 2014
…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: <html ng-app="name" ng-strict-di> <!-- ... --> </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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Is there currently a way to disable this in an app-wide fashion?
It would ensure that the correct notation is used and any potential issues with minification would arise while working with unminified code.
The text was updated successfully, but these errors were encountered: