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.
Move $route and ngView into angular-route.js #2804
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.
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?
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.
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.
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.
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.
@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.
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.
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.
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
.
Activity
L42y commentedon May 27, 2013
Awesome! can't wait for this.
ce-compcode commentedon May 27, 2013
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?
petebacondarwin commentedon May 27, 2013
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.
petebacondarwin commentedon May 27, 2013
For backward compatibility you would simply load up the angular-route.js file and make your app depend upon ngRoute .
geddski commentedon May 27, 2013
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
IgorMinar commentedon May 27, 2013
@geddski my plans for angular v2 are even more radical than that. stay tuned :)
geddski commentedon May 27, 2013
@IgorMinar mind blown. Let me know how I can help.
IgorMinar commentedon May 27, 2013
v1.2 first, then we'll roll out the plan forward.
btford commentedon May 27, 2013
+1. Would love to make this optional.
escalant3 commentedon May 27, 2013
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.
mhevery commentedon May 28, 2013
+1
geddski commentedon Jun 7, 2013
Woohoo
terra-novalis commentedon Jun 8, 2013
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.
lrlopez commentedon Jun 8, 2013
@icenine457, yep. You've to include
<script src="angular-route.js"></script>after includingangular.js.Have a look into the commit description for more information: 5599b55
geddski commentedon Jun 11, 2013
@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.
jeme commentedon Jul 4, 2013
👍 * 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.
petebacondarwin commentedon Jul 4, 2013
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:
basarat commentedon Sep 2, 2013
Here is another router : http://angular-route-segment.com/