From c2989f6cc6ea8be34101b9ab9bc25d14a2468e20 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Sun, 4 Mar 2012 00:53:45 -0800 Subject: fix(ng-include): Compile only content --- test/widgetsSpec.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'test/widgetsSpec.js') diff --git a/test/widgetsSpec.js b/test/widgetsSpec.js index f75d81c2..3d2f0a56 100644 --- a/test/widgetsSpec.js +++ b/test/widgetsSpec.js @@ -245,6 +245,24 @@ describe('widget', function() { })); + it('should compile only the content', inject(function($compile, $rootScope, $templateCache) { + // regression + + var onload = jasmine.createSpy('$contentLoaded'); + $rootScope.$on('$contentLoaded', onload); + $templateCache.put('tpl.html', [200, 'partial {{tpl}}', {}]); + + element = $compile('
' + + '
')($rootScope); + expect(onload).not.toHaveBeenCalled(); + + $rootScope.$apply(function() { + $rootScope.tpl = 'tpl.html'; + }); + expect(onload).toHaveBeenCalledOnce(); + })); + + describe('autoscoll', function() { var autoScrollSpy; -- cgit v1.2.3