mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-23 19:40:56 +08:00
fix(ngInclude): ensure ngInclude is terminal and uses its own manual transclusion system
This commit is contained in:
committed by
Misko Hevery
parent
45dc9ee7b4
commit
1b5bee4fa1
@@ -280,6 +280,31 @@ describe('ngInclude', function() {
|
||||
dealoc(element);
|
||||
}));
|
||||
|
||||
it('should compile only the inner content once', function() {
|
||||
var log = [];
|
||||
|
||||
module(function($compileProvider) {
|
||||
$compileProvider.directive('compileLog', function() {
|
||||
return {
|
||||
compile: function() {
|
||||
log.push('compile');
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
inject(function($compile, $rootScope, $templateCache) {
|
||||
$templateCache.put('tpl.html', [200, '<div compile-log>123</div>', {}]);
|
||||
element = $compile('<div><div ng-include="exp"></div></div>')($rootScope);
|
||||
|
||||
$rootScope.exp = 'tpl.html';
|
||||
$rootScope.$digest();
|
||||
|
||||
expect(element.text()).toBe('123');
|
||||
expect(log).toEqual(['compile']);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
describe('autoscoll', function() {
|
||||
var autoScrollSpy;
|
||||
|
||||
Reference in New Issue
Block a user