angular/angular.js — pull request #2738 by lgalfaso (2013-05-21 22:52:49+00:00)
Title: fix(compile): directive controller order fix

When there are two nested directives that the parent directive defines a controller, has `transclude: true`, has a templateUrl, the template has on the top level element the directive `ng-transclude` then the directive `ng-transclude` is applied before the parent directive. Now, if there is a nested child directive that also defines a controller and this controller needs to reference the parent controller, then given that `ng-transclude` was applied before the parent directive controller, the child directive is not able to reference the parent directive controller.

This patch changes this so the parent directive controller is applied before any directive on the top level element on the template (that is referenced from a templateUrl)