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.

Move $route and ngView into angular-route.js #2804

Closed

Description

@IgorMinar

Even if some of us don't want to admit it, I think we all feel that our lovely $route is approaching its EOL.

We'll need to completely rethink routing in angular apps in the future and projects like ui-router look like a great starting point.

Additionally since we see a considerable number of smaller apps out there that don't require routing at all, and mobile apps handle routing differently than desktop apps, it doesn't make sense to require everyone to download angular.min.js with all the bytes that our code responsible for routing weights.

For these reasons I'd like to propose that we move $route and ngView code into a separate file and module called angular-route.js and ngRoute respectively.

Activity

  1. L42y commented on May 27, 2013

    @L42y

    Awesome! can't wait for this.

  2. ce-compcode commented on May 27, 2013

    @ce-compcode

    For the sake of backward compatibility, what are everyone's views? If I have an app using $route and related events - I believe they should work in new model. Any views?

  3. petebacondarwin commented on May 27, 2013

    @petebacondarwin
    Contributor

    This is s good idea. There are a variety of scenarios that need different solutions, as igor points out. Ui-router is an interesting alternative as is Andy's mobile project. One should be able to choose from a variety of modules both provided by Google and by third parties.

  4. petebacondarwin commented on May 27, 2013

    @petebacondarwin
    Contributor

    For backward compatibility you would simply load up the angular-route.js file and make your app depend upon ngRoute .

  5. geddski commented on May 27, 2013

    @geddski
    Contributor

    I agree with this change. Honestly, I think we should do the same with as many included components as possible. Angular is a rock-solid HTML compiler that happens to come with some common framework components. The latter should be optional and easily replaced by userland modules.

    Here is another decent looking little router.
    https://github.com/tildeio/router.js

  6. IgorMinar commented on May 27, 2013

    @IgorMinar
    ContributorAuthor

    @geddski my plans for angular v2 are even more radical than that. stay tuned :)

  7. geddski commented on May 27, 2013

    @geddski
    Contributor

    @IgorMinar mind blown. Let me know how I can help.

  8. IgorMinar commented on May 27, 2013

    @IgorMinar
    ContributorAuthor

    v1.2 first, then we'll roll out the plan forward.

  9. btford commented on May 27, 2013

    @btford
    Contributor

    +1. Would love to make this optional.

  10. escalant3 commented on May 27, 2013

    @escalant3
    Contributor

    This is great news. I didn't know about ui-router but after checking it out is really similar to a route-service I wrote for the app I am working on. Everything pointing to a common community maintained solution is good.

  11. mhevery commented on May 28, 2013

    @mhevery
    Contributor

    +1

  12. geddski commented on Jun 7, 2013

    @geddski
    Contributor

    Woohoo

  13. terra-novalis commented on Jun 8, 2013

    @terra-novalis

    While this seems like absolutely the right way to go, I'm a little confused. Am I going to need to reference angular-route.js in my application now? I've tried upgrading my apps copy of angular today to the latest master, but received an Unknown provider: $routeParams when doing so.

    Either way, sounds like this is a step in the right direction.

    EDIT: Missed the bit about ngRoute. I think I can get it working. Thanks to @petebacondarwin and @lrlopez.

  14. lrlopez commented on Jun 8, 2013

    @lrlopez
    Contributor

    @icenine457, yep. You've to include <script src="angular-route.js"></script> after including angular.js.

    Have a look into the commit description for more information: 5599b55

  15. geddski commented on Jun 11, 2013

    @geddski
    Contributor

    @IgorMinar whatever replacement router/view should be able to handle multiple injectors and auto-bootstrapping of independent modules. I'm working on a rewritten ng-view that does this, so far so good. Will show when ready.

  16. jeme commented on Jul 4, 2013

    @jeme

    👍 * A Million....

    This makes it much easier for projects like https://github.com/dotJEM/angular-routing, https://github.com/angular-ui/ui-router ect. to have a much cleaner path forward...

    Is there any thoughts towards making some sort of custom builds where you can check of what modules you wan't in one big minified file? I know it sort of breaks the idea of CDN's but at the same time the more modulized angular gets, the more http requests you end up with unless you merge them.

  17. petebacondarwin commented on Jul 4, 2013

    @petebacondarwin
    Contributor

    If your project is big enough that it is concerned about download size and
    number of requests then it should have its own build process and be
    concatenating and minifying its code itself.

    On 4 July 2013 09:56, Jens Melgaard notifications@github.com wrote:

    [image: 👍] * A Million....

    This makes it much easier for projects like
    https://github.com/dotJEM/angular-routing,
    https://github.com/angular-ui/ui-router ect. to have a much cleaner path
    forward...

    Is there any thoughts towards making some sort of custom builds where you
    can check of what modules you wan't in one big minified file? I know it
    sort of breaks the idea of CDN's but at the same time the more modulized
    angular gets, the more http requests you end up with unless you merge them.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/2804#issuecomment-20466273
    .

  18. basarat commented on Sep 2, 2013

    @basarat
    Contributor

    Here is another router : http://angular-route-segment.com/

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions