aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/compileSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/compileSpec.js')
-rw-r--r--test/ng/compileSpec.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js
index a002171b..363b4329 100644
--- a/test/ng/compileSpec.js
+++ b/test/ng/compileSpec.js
@@ -298,6 +298,25 @@ describe('$compile', function() {
expect(log).toEqual('LOG; LOG');
});
});
+
+
+ it('should allow modifying the DOM structure in post link fn', function() {
+ module(function() {
+ directive('removeNode', valueFn({
+ link: function($scope, $element) {
+ $element.remove();
+ }
+ }));
+ });
+ inject(function($compile, $rootScope) {
+ element = jqLite('<div><div remove-node></div><div>{{test}}</div></div>');
+ $rootScope.test = 'Hello';
+ $compile(element)($rootScope);
+ $rootScope.$digest();
+ expect(element.children().length).toBe(1);
+ expect(element.text()).toBe('Hello');
+ });
+ })
});
describe('compiler control', function() {