From 40c0220c47c620070b30aec6ec4552c68a8689eb Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Fri, 30 Aug 2013 09:39:08 -0400 Subject: fix(ngView): ensure ngClass works with together with ngView's transclusion behavior Closes: #3727 --- src/ngRoute/directive/ngView.js | 1 + test/ngRoute/directive/ngViewSpec.js | 40 ++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/src/ngRoute/directive/ngView.js b/src/ngRoute/directive/ngView.js index 3b97367c..d67d8a76 100644 --- a/src/ngRoute/directive/ngView.js +++ b/src/ngRoute/directive/ngView.js @@ -176,6 +176,7 @@ function ngViewFactory( $route, $anchorScroll, $compile, $controller, return { restrict: 'ECA', terminal: true, + priority: 1000, transclude: 'element', compile: function(element, attr, linker) { return function(scope, $element, attr) { diff --git a/test/ngRoute/directive/ngViewSpec.js b/test/ngRoute/directive/ngViewSpec.js index 1bce2b62..d354a355 100644 --- a/test/ngRoute/directive/ngViewSpec.js +++ b/test/ngRoute/directive/ngViewSpec.js @@ -600,6 +600,46 @@ describe('ngView animations', function() { expect(itemA).not.toEqual(itemB); var itemB = $animate.flushNext('enter').element; })); + + it('should render ngClass on ngView', + inject(function($compile, $rootScope, $templateCache, $animate, $location, $timeout) { + + var item; + $rootScope.tpl = 'one'; + $rootScope.klass = 'classy'; + element = $compile(html('