marcel
marcel

Reputation: 3272

AngularJS change location

I'd like to call a route with parameters by myself.

I found the $location.search - function that could be used, but it doesn't work with my configuration:

$location.search('/students', {id:id});
$location.path('/students').search({id:id});

Both don't work.

Upvotes: 0

Views: 46

Answers (1)

Brocco
Brocco

Reputation: 64883

Assuming your route is defined as:

'/students/:id'

Then you would need to set your location path by:

$location.path('/students/' + id);

Upvotes: 1

Related Questions