Skip to content

Commit

Permalink
docs(error/$injector/modulerr): add info about not monkey-patching ng
Browse files Browse the repository at this point in the history
  • Loading branch information
petebacondarwin committed Oct 20, 2014
1 parent 303610c commit d97b427
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/content/error/$injector/modulerr.ngdoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,22 @@
This error occurs when a module fails to load due to some exception. The error
message above should provide additional context.

### Using `ngRoute`

In AngularJS `1.2.0` and later, `ngRoute` has been moved to its own module.
If you are getting this error after upgrading to `1.2.x` or later, be sure that you've
installed {@link ngRoute `ngRoute`}.

### Monkey-patching Angular's `ng` module

This error can also occur if you have tried to add your own components to the `ng` module.
This has never been supported and from `1.3.0` it will actually trigger this error.
For instance the following code could trigger this error.

```js
angular.module('ng').filter('tel', function (){});
```

Instead create your own module and add it as a dependency to your application's top-level module.
See [#9692](https://github.com/angular/angular.js/issues/9692) and
[#7709](https://github.com/angular/angular.js/issues/7709) for more information

0 comments on commit d97b427

Please sign in to comment.