diff options
| author | Igor Minar | 2010-10-12 05:36:38 +0800 |
|---|---|---|
| committer | Misko Hevery | 2010-10-13 04:37:46 +0800 |
| commit | 70ff7a2639fc55936854ad04a6242a700ae71a02 (patch) | |
| tree | be82632c890b9734d50cd681737b6bad9a689d91 /test/ValidatorsTest.js | |
| parent | 7e47a2d016676f37287203f26689cce1ee1eaa0c (diff) | |
| download | angular.js-70ff7a2639fc55936854ad04a6242a700ae71a02.tar.bz2 | |
fix memory leak caused by leftbehind $invalidWidgets references
- ng:switch should not clean up $invalidWidgets
- $invalidWidgets should be clean up after each eval
- add missing docs
Diffstat (limited to 'test/ValidatorsTest.js')
| -rw-r--r-- | test/ValidatorsTest.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/test/ValidatorsTest.js b/test/ValidatorsTest.js index ca8dad12..07f3e488 100644 --- a/test/ValidatorsTest.js +++ b/test/ValidatorsTest.js @@ -99,16 +99,13 @@ describe('Validator:asynchronous', function(){ var value, fn; beforeEach(function(){ - var invalidWidgets = angularService('$invalidWidgets')(); value = null; fn = null; - self = { - $element:jqLite('<input />'), - $invalidWidgets:invalidWidgets, - $eval: noop - }; + self = compile('<input />'); + jqLite(document.body).append(self.$element); self.$element.data('$validate', noop); self.$root = self; + self.$init(); }); afterEach(function(){ @@ -121,6 +118,7 @@ describe('Validator:asynchronous', function(){ it('should make a request and show spinner', function(){ var value, fn; var scope = compile('<input type="text" name="name" ng:validate="asynchronous:asyncFn"/>'); + jqLite(document.body).append(scope.$element); scope.$init(); var input = scope.$element; scope.asyncFn = function(v,f){ |
