angular/angular.js — pull request #3332 by jardilio (2013-07-24 20:50:33+00:00)
Title: Route continues to be processed event if providing a redirectTo

If a route defines a redirectTo value, the current route should stop processing the route and instead wait to process the route of the redirect.

Currently, what is happening is that Angular detects a redirectTo value and updates $location, but then continues processing the route that was intended to be redirected. Templates are loaded, resolves are processed, ng-view then updates the view with a new template and instantiates the controller all for a route that should have been redirected.

A common use case for assigning a function to the redirectTo is to validation authentication, permission check, or some other logic to determine if the route should continue or redirect else where. In the end, this happens, but in between, unexpected results may occur by updating the view and instantiating controllers for logic that wasn't expected to be executed.

http://plnkr.co/edit/8QlA0ouuePH3p35Ntmjy?p=preview