In my app I have a category page that has links to a various product list pages. If it turns out that when you get to a product list page there is only one product then it
If using the $location object in order to switch views, a way of doing the same as in @alt255 's post is by using the replace() method after calling path("..."):