aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ng/directive/ngInclude.js1
-rw-r--r--test/ng/directive/ngIncludeSpec.js26
2 files changed, 27 insertions, 0 deletions
diff --git a/src/ng/directive/ngInclude.js b/src/ng/directive/ngInclude.js
index 0f1f245c..ccb26bab 100644
--- a/src/ng/directive/ngInclude.js
+++ b/src/ng/directive/ngInclude.js
@@ -153,6 +153,7 @@ var ngIncludeDirective = ['$http', '$templateCache', '$anchorScroll', '$compile'
function($http, $templateCache, $anchorScroll, $compile, $animate, $sce) {
return {
restrict: 'ECA',
+ priority: 1000,
terminal: true,
transclude: 'element',
compile: function(element, attr, transclusion) {
diff --git a/test/ng/directive/ngIncludeSpec.js b/test/ng/directive/ngIncludeSpec.js
index ffe6a998..b8b0c16b 100644
--- a/test/ng/directive/ngIncludeSpec.js
+++ b/test/ng/directive/ngIncludeSpec.js
@@ -286,6 +286,32 @@ describe('ngInclude', function() {
}));
+ it('should not break attribute bindings on the same element', inject(function($compile, $rootScope, $httpBackend) {
+ // regression #3793
+
+ element = $compile('<div><span foo="#/{{hrefUrl}}" ng:include="includeUrl"></span></div>')($rootScope);
+ $httpBackend.expect('GET', 'url1').respond('template text 1');
+ $rootScope.hrefUrl = 'fooUrl1';
+ $rootScope.includeUrl = 'url1';
+ $rootScope.$digest();
+ $httpBackend.flush();
+ expect(element.text()).toBe('template text 1');
+ expect(element.find('span').attr('foo')).toBe('#/fooUrl1');
+
+ $httpBackend.expect('GET', 'url2').respond('template text 2');
+ $rootScope.includeUrl = 'url2';
+ $rootScope.$digest();
+ $httpBackend.flush();
+ expect(element.text()).toBe('template text 2');
+ expect(element.find('span').attr('foo')).toBe('#/fooUrl1');
+
+ $rootScope.hrefUrl = 'fooUrl2';
+ $rootScope.$digest();
+ expect(element.text()).toBe('template text 2');
+ expect(element.find('span').attr('foo')).toBe('#/fooUrl2');
+ }));
+
+
describe('autoscoll', function() {
var autoScrollSpy;