2012-03-08 23:00:38 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
2012-04-09 18:20:55 +00:00
|
|
|
describe('ngNonBindable', function() {
|
2012-03-08 23:00:38 +00:00
|
|
|
var element;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
afterEach(function(){
|
|
|
|
|
dealoc(element);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2012-03-13 21:42:26 +00:00
|
|
|
it('should prevent compilation of the owning element and its children',
|
2012-03-08 23:00:38 +00:00
|
|
|
inject(function($rootScope, $compile) {
|
2012-03-13 20:49:05 +00:00
|
|
|
element = $compile('<div ng-non-bindable text="{{name}}"><span ng-bind="name"></span></div>')($rootScope);
|
2012-03-08 23:00:38 +00:00
|
|
|
$rootScope.name = 'misko';
|
|
|
|
|
$rootScope.$digest();
|
|
|
|
|
expect(element.text()).toEqual('');
|
2012-03-13 20:49:05 +00:00
|
|
|
expect(element.attr('text')).toEqual('{{name}}');
|
2012-03-08 23:00:38 +00:00
|
|
|
}));
|
|
|
|
|
});
|