You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
The core of issue was attempt to register new filter in third party library.
angular.module('ng').filter('tel',function(){});
There are few libraries with behavior like this. It will be great to add init/lock life cycle and say directly that ng module is prohibited for extension.
The reason this happens is because now, $providers are always run before config blocks --- however in the case of the ng module, all of the work is actually done in a config block, so this breaks. (This is because of the commit @Narretz is referencing)
This is a breaking change that wasn't mentioned in the changelog, unfortunately.
@ifyify I feel like this falls under the category of "probably not the best way to do things." What are the 3rd party libraries that do this? If they are open source and on GitHub, I'd like to file issues against them.
If mine subcontractors did that, anyone else can do it again.
You have great URL based error explanation: extend it to bad practices (for non production code base) attach to discussion thread and it will be really great.
It is the C style int32 problem, solve it and people will love you...
Honestly, I don't think it even makes sense to document this more thoroughly.
The official Angular documentation shows how to correctly register filters.
The official Angular documentation rarely mentions the internal ng module. You have to go out of your way to find it. Nothing about the documentation or API suggests that modifying this module is a reasonable thing to do.
Activity
[-]Are you will filterProvider or something?[/-][+]Can't upgrade from beta.7 to beta.8-10[/+]lgalfaso commentedon Jun 5, 2014
Hi,
Any chance you can create an example (e.g using http://plnkr.co) ?
Narretz commentedon Jun 5, 2014
beta.8 includes a breaking change regarding provider registration, see
https://github.com/angular/angular.js/blob/master/CHANGELOG.md#130-beta8-accidental-haiku-2014-05-09
Maybe that's related?
ifyify commentedon Jun 17, 2014
Same on beta13.
The core of issue was attempt to register new filter in third party library.
There are few libraries with behavior like this. It will be great to add init/lock life cycle and say directly that ng module is prohibited for extension.
caitp commentedon Jun 17, 2014
Please post a repro, it's possible that it's a regression
caitp commentedon Jun 17, 2014
Nevermind, I can reproduce this with http://plnkr.co/edit/txehajjSSoMV71at9Ygc?p=preview
I'll look into this today
caitp commentedon Jun 17, 2014
The reason this happens is because now, $providers are always run before config blocks --- however in the case of the
ngmodule, all of the work is actually done in a config block, so this breaks. (This is because of the commit @Narretz is referencing)This is a breaking change that wasn't mentioned in the changelog, unfortunately.
caitp commentedon Jun 17, 2014
Anyways, I'll put together a fix for this (but I'm not sure "extending" the ng module was ever really a supported use case)
fix(loader): allow 'ng' module to be extended with filters/directives…
btford commentedon Jun 20, 2014
@ifyify I feel like this falls under the category of "probably not the best way to do things." What are the 3rd party libraries that do this? If they are open source and on GitHub, I'd like to file issues against them.
caitp commentedon Jun 20, 2014
I agree with Brian, on this one, fwiw, it's really a bizarre thing to do
1 remaining item
IgorMinar commentedon Jun 24, 2014
this is invalid use of our apis. please create a module for your stuff rather than piggy-back on the ng module.
ifyify commentedon Jun 24, 2014
If mine subcontractors did that, anyone else can do it again.
You have great URL based error explanation: extend it to bad practices (for non production code base) attach to discussion thread and it will be really great.
It is the C style int32 problem, solve it and people will love you...
./F
On Jun 24, 2014, at 14:45, Igor Minar notifications@github.com wrote:
btford commentedon Jun 26, 2014
Honestly, I don't think it even makes sense to document this more thoroughly.
ngmodule. You have to go out of your way to find it. Nothing about the documentation or API suggests that modifying this module is a reasonable thing to do.There are so many more important things for us to work on.
docs(error/$injector/modulerr): add info about not monkey-patching `ng`
digish777 commentedon Oct 6, 2016
What is the solution to this issue?
gkalpak commentedon Oct 6, 2016
@digish777, this issue is about a very old Angular 1.x version (1.3.0.beta.8 specifically).
Are you sure you are having the same issue?
digish777 commentedon Oct 7, 2016
My office is trying to upgrade from 1.2.2 to 1.5. this filter is standing in the way. do not know how to fix this. that is why I asked.
digish777 commentedon Oct 7, 2016
http://plnkr.co/edit/txehajjSSoMV71at9Ygc?p=preview
This is exactly what is happening to me.
digish777 commentedon Oct 7, 2016
Uncaught Error: [$injector:modulerr] Failed to instantiate module ng due to:
Error: [$injector:unpr] Unknown provider: $filterProvider
digish777 commentedon Oct 7, 2016
I found the issue is happening at 1.3.0-beta.8. What got changed and how to fix it.?
gkalpak commentedon Oct 7, 2016
The cause of the problem is explained in the comments above. In a nutshell, you should not be putting stuff on the
ngmodule.The proper way to solve this is to create your own module and add that as a dependency to your other modules. E.g.:
The hacky, unrecommended, non-future-proof way to work around it is:
SudhaSusarita commentedon May 30, 2020
My case was,in my HTML file, I have declared ng-app="MyApplication" in two places.
While I removed that, the error was resolved.