Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs($controller): deprecate the use of $controllerProvider#allowGlobals #15230

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/ng/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ function $ControllerProvider() {
* @ngdoc method
* @name $controllerProvider#allowGlobals
* @description If called, allows `$controller` to find controller constructors on `window`
*
* @deprecated
* This method of finding controllers has been deprecated. This will be removed in 1.7.
*/
this.allowGlobals = function() {
globals = true;
Expand All @@ -79,7 +82,7 @@ function $ControllerProvider() {
* * check if a controller with given name is registered via `$controllerProvider`
* * check if evaluating the string on the current scope returns a constructor
* * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
* `window` object (not recommended)
* `window` object (deprecated, not recommended)
*
* The string can use the `controller as property` syntax, where the controller instance is published
* as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
Expand Down
2 changes: 1 addition & 1 deletion src/ng/directive/ngController.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
*
* If the current `$controllerProvider` is configured to use globals (via
* {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may
* also be the name of a globally accessible constructor function (not recommended).
* also be the name of a globally accessible constructor function (deprecated, not recommended).
*
* @example
* Here is a simple form for editing user contact information. Adding, removing, clearing, and
Expand Down
2 changes: 1 addition & 1 deletion src/ngMock/angular-mocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -2225,7 +2225,7 @@ angular.mock.$RootElementProvider = function() {
* * check if a controller with given name is registered via `$controllerProvider`
* * check if evaluating the string on the current scope returns a constructor
* * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
* `window` object (not recommended)
* `window` object (deprecated, not recommended)
*
* The string can use the `controller as property` syntax, where the controller instance is published
* as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
Expand Down