Skip to content

Commit d97b427

Browse files
docs(error/$injector/modulerr): add info about not monkey-patching ng
Closes angular#7709 Closes angular#9692
1 parent 303610c commit d97b427

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/content/error/$injector/modulerr.ngdoc

+16
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@
66
This error occurs when a module fails to load due to some exception. The error
77
message above should provide additional context.
88

9+
### Using `ngRoute`
10+
911
In AngularJS `1.2.0` and later, `ngRoute` has been moved to its own module.
1012
If you are getting this error after upgrading to `1.2.x` or later, be sure that you've
1113
installed {@link ngRoute `ngRoute`}.
14+
15+
### Monkey-patching Angular's `ng` module
16+
17+
This error can also occur if you have tried to add your own components to the `ng` module.
18+
This has never been supported and from `1.3.0` it will actually trigger this error.
19+
For instance the following code could trigger this error.
20+
21+
```js
22+
angular.module('ng').filter('tel', function (){});
23+
```
24+
25+
Instead create your own module and add it as a dependency to your application's top-level module.
26+
See [#9692](https://github.com/angular/angular.js/issues/9692) and
27+
[#7709](https://github.com/angular/angular.js/issues/7709) for more information

0 commit comments

Comments
 (0)