Reputation: 27
Is possible to switch to another angular view in controller? I meant something like this:
function ItemController($http, $routeParams) {
$http.get('/api/item/' + $routeParams.ItemId).then(function(response) {
self.related_item = response.data['related_item_id'];
if (self.related_item != 10) {
switch_to_another_view('#!/items/' + self.related_item);
}
});
}
Upvotes: 0
Views: 49
Reputation: 222522
If you are using angular-router or $routeProvider, do it as:
$location.path('items')
Upvotes: 1