Hi Nick,
I got around the lack of reloadOnPath:false by doing the following:
$routeProvider.when('/object/:objectId', {...})
When the app want's to change the object id without reloading the
controllers set the path params on the current route:
var id = '...';
$route.current.pathParams.objectId = id;
$location.path('/object/' + id);
angular-route checks if the path params change before processing the
$routeChangeStart
event and instead generates a $routeUpdate event.
I know you've moved away from ng-view, but I thought you might be
interested.
On Tuesday, March 13, 2012 9:41:01 PM UTC-4, Nick Retallack wrote:
>
> Misko: I asked how to handle some situations and suggested features that
> would make things easier to deal with.
>
> I thought it would be nice to add something like reloadOnPath:false (based
> on reloadOnSearch:false) so that angular would not recreate your controller
> if the new path still routed to the same controller, but instead call $on
> '$routeChange'. You could make both this and reloadOnSearch's default
> values be configurable without editing the angular source code. This would
> allow pretty urls without forcing you to re-evaluate your controller every
> time the url changed.
>
> I also asked how to handle my url situation in 10.6. If you have two url
> patterns pointing to the same place, how can you tell which one the router
> followed? I thought it would be useful to add extra values into a route
> expression to be passed on as $routeParams even if they weren't in the url.
> That would make controllers more reusable in different contexts.
>
--
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/d/optout.