From a08cbc02e78e789a66e9af771c410e8ad1646e25 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Fri, 23 Mar 2012 15:53:04 -0700 Subject: feat($compile): do not interpolate boolean attributes, rather evaluate them So that we can have non string values, e.g. ng-value="true" for radio inputs Breaks boolean attrs are evaluated rather than interpolated To migrate your code, change: to: Affected directives: * ng-multiple * ng-selected * ng-checked * ng-disabled * ng-readonly * ng-required --- test/service/compilerSpec.js | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'test/service') diff --git a/test/service/compilerSpec.js b/test/service/compilerSpec.js index 698fc23e..dc2e20cf 100644 --- a/test/service/compilerSpec.js +++ b/test/service/compilerSpec.js @@ -1411,22 +1411,6 @@ describe('$compile', function() { }); - it('should set boolean attributes', function() { - attr.$set('disabled', 'true'); - attr.$set('readOnly', 'true'); - expect(element.attr('disabled')).toEqual('disabled'); - expect(element.attr('readonly')).toEqual('readonly'); - - attr.$set('disabled', 'false'); - expect(element.attr('disabled')).toEqual(undefined); - - attr.$set('disabled', false); - attr.$set('readOnly', false); - expect(element.attr('disabled')).toEqual(undefined); - expect(element.attr('readonly')).toEqual(undefined); - }); - - it('should remove attribute', function() { attr.$set('ngMyAttr', 'value'); expect(element.attr('ng-my-attr')).toEqual('value'); -- cgit v1.2.3