Using routeParams is a great way to pass some data in to your app at load 
time. The useful data is part of the URL, and you get access to it by name 
in the routeParams. But if your app is really simple, you might not want 
the overhead of multiple routing and views. You might just have a single 
view, so having to break it up with ng-view is an unnecessary annoyance 
when you could easily just get by with your main index page. Sure, you 
could use routeProvider to name the routeParams you're interested in, 
specifying a single route:

.when('/myurl/:id' {controller: ctrl, template:''})

But if this is the only config you're doing, it seems like way too much 
baggage just to apply some names to fragments of the URL.

It'd be much nicer to have a service or somesuch that you can call from a 
controller that lets you extract parts of the URL, without needing ngRoute 
and configuration of the routeProvider.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to