I love ui-router but in this particular project we are already using
ngRoute and there's not really an option to switch.

I can't see a way of doing this with the $route service, which seems a
little strange.

On Friday, October 24, 2014, Eric Eslinger <[email protected]> wrote:

> I use ui-router, which exposes ui-sref in the HTML side
> (ui-sref="app.search({query: 'foo', sort: 'asc'})" converts into an
> appropriate a href or onclick if it's not in an anchor element) and
> $state.go on the controller side which works more or less the same way.
> Dunno if the basic router does that, but ui-router is pretty rad in general.
>
> On Fri Oct 24 2014 at 9:14:29 AM Marc Fallows <[email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote:
>
>> Is the route interpolation exposed anywhere? It seem fairly hidden, but
>> would be a useful thing to take advantage of so I don't have to rewrite the
>> logic on my end.
>>
>> For example say I want to have the following in my controller:
>>
>> var searchRoute = "/search/:query/:sort?/:limit?";
>>
>> $scope.goToSearch = function(opts){
>>    // opts could be {query: 'foo', limit: 10}
>>
>>    var url = $route.interpolate(searchRoute, opts);
>>    $location.path(url);
>> };
>>
>> Obviously $route.interpolate doesn't exist. Is there something that
>> exists which could do this?
>>
>> Otherwise I have to interpolate that searchRoute myself, which seems
>> silly given that Angular already does this.
>>
>>  --
>> 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]
>> <javascript:_e(%7B%7D,'cvml','angular%[email protected]');>.
>> To post to this group, send email to [email protected]
>> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/d/optout.
>>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/bEX5Ateee98/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected]
> <javascript:_e(%7B%7D,'cvml','angular%[email protected]');>.
> To post to this group, send email to [email protected]
> <javascript:_e(%7B%7D,'cvml','[email protected]');>.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Marc Fallows
[email protected]

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

Reply via email to