From f38010d3a2f457a53798212ef72418637dabe189 Mon Sep 17 00:00:00 2001
From: Igor Minar
Date: Thu, 20 Oct 2011 15:37:37 -0700
Subject: fix(compiler): revert 8611ebe6 - calling \$digest after linking
Change introduced by me in 8611ebe6 results in considerable inefficiencies when the compiler
and linker is used from within a widget, in which case, we call $digest unnecessary since it
will be called by the $apply which called the directive/widget in the first place.
There are only two places when the extra $digest call can be useful - when manually bootstrapping
the app or in tests. However even in tests this behavior can result in unwanted results (especially
when ng:controller is involved). So it is better to leave it for the developer to call $digest
when it is really needed.
---
test/CompilerSpec.js | 4 ----
test/markupSpec.js | 14 +++-----------
2 files changed, 3 insertions(+), 15 deletions(-)
(limited to 'test')
diff --git a/test/CompilerSpec.js b/test/CompilerSpec.js
index 2cb7d19d..860cea4a 100644
--- a/test/CompilerSpec.js
+++ b/test/CompilerSpec.js
@@ -110,7 +110,6 @@ describe('compiler', function() {
expect(sortedHtml(scope.$element)).
toEqual('
' +
'before<#comment>#comment>' +
- 'x' +
'after' +
'
');
scope.value = 1;
@@ -119,7 +118,6 @@ describe('compiler', function() {
toEqual('' +
'before<#comment>#comment>' +
'x' +
- 'x' +
'after' +
'
');
scope.value = 2;
@@ -129,7 +127,6 @@ describe('compiler', function() {
'before<#comment>#comment>' +
'x' +
'x' +
- 'x' +
'after' +
'');
scope.value = 3;
@@ -140,7 +137,6 @@ describe('compiler', function() {
'x' +
'x' +
'x' +
- 'x' +
'after' +
'');
});
diff --git a/test/markupSpec.js b/test/markupSpec.js
index a05ca44f..41255b4a 100644
--- a/test/markupSpec.js
+++ b/test/markupSpec.js
@@ -167,20 +167,12 @@ describe("markups", function() {
});
it('should bind Text with no Bindings', function() {
- forEach(['checked', 'disabled', 'multiple', 'readonly', 'selected'], function(name) {
+ forEach(['checked', 'disabled', 'multiple', 'readonly', 'selected', 'src', 'href'],
+ function(name) {
compile('');
- expect(element.attr('ng:bind-attr')).toBe('{"' + name +'":"some"}');
- expect(element.attr(name)).toBe(name);
+ expect(sortedHtml(element)).toEqual('');
dealoc(element);
});
-
- compile('');
- expect(sortedHtml(element)).toEqual('');
- dealoc(element);
-
- compile('');
- expect(sortedHtml(element)).toEqual('');
- dealoc(element);
});
it('should Parse Text With No Bindings', function() {
--
cgit v1.2.3