diff options
| author | Vojta Jina | 2012-03-23 15:53:04 -0700 |
|---|---|---|
| committer | Vojta Jina | 2012-03-26 21:14:09 -0700 |
| commit | a08cbc02e78e789a66e9af771c410e8ad1646e25 (patch) | |
| tree | bc7081b11d6d1ed4cd5bde3a9e059e5c964e75a8 /test/service/compilerSpec.js | |
| parent | 55027132f3d57e5dcf94683e6e6bd7b0aae0087d (diff) | |
| download | angular.js-a08cbc02e78e789a66e9af771c410e8ad1646e25.tar.bz2 | |
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: <input ng-disabled="{{someBooleanVariable}}">
to: <input ng-disabled="someBooleanVariabla">
Affected directives:
* ng-multiple
* ng-selected
* ng-checked
* ng-disabled
* ng-readonly
* ng-required
Diffstat (limited to 'test/service/compilerSpec.js')
| -rw-r--r-- | test/service/compilerSpec.js | 16 |
1 files changed, 0 insertions, 16 deletions
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'); |
