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

Can't upgrade from beta.7 to beta.8-10 #7709

Closed

Activity

  1. changed the title [-]Are you will filterProvider or something?[/-] [+]Can't upgrade from beta.7 to beta.8-10[/+] on Jun 5, 2014
  2. lgalfaso commented on Jun 5, 2014

    @lgalfaso
    Contributor

    Hi,
    Any chance you can create an example (e.g using http://plnkr.co) ?

  3. Narretz commented on Jun 5, 2014

    @Narretz
    Contributor

    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?

  4. ifyify commented on Jun 17, 2014

    @ifyify
    Author

    Same on beta13.

    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.

  5. caitp commented on Jun 17, 2014

    @caitp
    Contributor

    Please post a repro, it's possible that it's a regression

  6. caitp commented on Jun 17, 2014

    @caitp
    Contributor

    Nevermind, I can reproduce this with http://plnkr.co/edit/txehajjSSoMV71at9Ygc?p=preview

    I'll look into this today

  7. self-assigned this
    on Jun 17, 2014
  8. caitp commented on Jun 17, 2014

    @caitp
    Contributor

    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.

  9. caitp commented on Jun 17, 2014

    @caitp
    Contributor

    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)

  10. added a commit that references this issue on Jun 17, 2014
    ef4cd8d
  11. btford commented on Jun 20, 2014

    @btford
    Contributor

    There are few libraries with behavior like this.

    @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.

  12. caitp commented on Jun 20, 2014

    @caitp
    Contributor

    I agree with Brian, on this one, fwiw, it's really a bizarre thing to do

  13. 1 remaining item

  14. IgorMinar commented on Jun 24, 2014

    @IgorMinar
    Contributor

    this is invalid use of our apis. please create a module for your stuff rather than piggy-back on the ng module.

  15. ifyify commented on Jun 24, 2014

    @ifyify
    Author

    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:

    this is invalid use of our apis. please create a module for your stuff rather than piggy-back on the ng module.

    —
    Reply to this email directly or view it on GitHub.

  16. btford commented on Jun 26, 2014

    @btford
    Contributor

    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.
    • I explicitly added this to our list of poor practices for 3rd party components

    There are so many more important things for us to work on.

  17. added a commit that references this issue on Oct 20, 2014
    d97b427
  18. digish777 commented on Oct 6, 2016

    @digish777

    What is the solution to this issue?

  19. gkalpak commented on Oct 6, 2016

    @gkalpak
    Member

    @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?

  20. digish777 commented on Oct 7, 2016

    @digish777

    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.

  21. digish777 commented on Oct 7, 2016

    @digish777

    http://plnkr.co/edit/txehajjSSoMV71at9Ygc?p=preview

    This is exactly what is happening to me.

  22. digish777 commented on Oct 7, 2016

    @digish777

    Uncaught Error: [$injector:modulerr] Failed to instantiate module ng due to:
    Error: [$injector:unpr] Unknown provider: $filterProvider

  23. digish777 commented on Oct 7, 2016

    @digish777

    I found the issue is happening at 1.3.0-beta.8. What got changed and how to fix it.?

  24. gkalpak commented on Oct 7, 2016

    @gkalpak
    Member

    The cause of the problem is explained in the comments above. In a nutshell, you should not be putting stuff on the ng module.

    The proper way to solve this is to create your own module and add that as a dependency to your other modules. E.g.:

    angular.
      module('utils', []).
      filter('tel', function() { ... });
    
    angular.
      module('test', ['utils']).
      run(function(telFilter) {
        console.log(telFilter);
      });

    The hacky, unrecommended, non-future-proof way to work around it is:

    angular.
      module('ng').
      config(function($filterProvider) {
        $filterProvider.register('tel', function() { ... });
      });
  25. SudhaSusarita commented on May 30, 2020

    @SudhaSusarita

    My case was,in my HTML file, I have declared ng-app="MyApplication" in two places.
    While I removed that, the error was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions