diff options
| author | Misko Hevery | 2011-11-15 11:03:03 -0800 | 
|---|---|---|
| committer | Misko Hevery | 2011-11-15 11:44:36 -0800 | 
| commit | 5857c44e0cc52309251c932f9c530958dfdb616c (patch) | |
| tree | 76ceac6c4707ad4c42ab1160b6d473b5b461c025 /test/widget | |
| parent | 8adae2fdf272f3fa428cc9fe43c860c02b2d85fd (diff) | |
| download | angular.js-5857c44e0cc52309251c932f9c530958dfdb616c.tar.bz2 | |
fix(radio): fix binding to value={{exp}}
Diffstat (limited to 'test/widget')
| -rw-r--r-- | test/widget/inputSpec.js | 16 | 
1 files changed, 16 insertions, 0 deletions
diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index 8a35407b..085cb2ea 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -423,6 +423,22 @@ describe('widget: input', function() {          expect(inputs[0].checked).toBe(false);          expect(inputs[1].checked).toBe(true);        }); + +      it('should data-bind the value attribute on initialization', inject( +          function($rootScope, $compile){ +        $rootScope.choice = 'b'; +        $rootScope.items = ['a', 'b']; +        var element = $compile( +            '<li>'+ +              '<input ng:repeat="item in items" ' + +              '       type="radio" ng:model="choice" value="{{item}}" name="choice">'+ +            '</li>')($rootScope); + +        $rootScope.$digest(); +        var inputs = element.find('input'); +        expect(inputs[0].checked).toBe(false); +        expect(inputs[1].checked).toBe(true); +      }));      });  | 
