diff options
| author | Misko Hevery | 2010-04-16 14:01:29 -0700 |
|---|---|---|
| committer | Misko Hevery | 2010-04-16 14:01:29 -0700 |
| commit | deb86fe357a901889bc4289087f0b9e69cb8a302 (patch) | |
| tree | fce4db8501a6c24430d611c95a4aa001119c7b89 /test/directivesSpec.js | |
| parent | 70e401ef100614295fc808e32f0142f07c315461 (diff) | |
| download | angular.js-deb86fe357a901889bc4289087f0b9e69cb8a302.tar.bz2 | |
lots of small fixes
Diffstat (limited to 'test/directivesSpec.js')
| -rw-r--r-- | test/directivesSpec.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index 76a12616..1ddd7477 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -57,6 +57,22 @@ describe("directives", function(){ expect(element.attr('alt')).toEqual('myalt'); }); + it('should remove special attributes on false', function(){ + var scope = compile('<div disabled="{{disabled}}" readonly="{{readonly}}" checked="{{checked}}"/>'); + expect(scope.$element.attr('disabled')).toEqual(null); + expect(scope.$element.attr('readonly')).toEqual(null); + expect(scope.$element.attr('checked')).toEqual(null); + + scope.disabled = true; + scope.readonly = true; + scope.checked = true; + scope.$eval(); + + expect(scope.$element.attr('disabled')).not.toEqual(null); + expect(scope.$element.attr('readonly')).not.toEqual(null); + expect(scope.$element.attr('checked')).not.toEqual(null); + }); + it('should ng-non-bindable', function(){ var scope = compile('<div ng-non-bindable><span ng-bind="name"></span></div>'); scope.$set('name', 'misko'); |
