From d83a92c12138ab53d1a6c6eae7d0cf9300514e8c Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Thu, 13 Oct 2011 16:58:44 -0700 Subject: fix(checkbox): prefix true-value & false-value with ng: --- src/widget/input.js | 10 +++++----- test/widget/inputSpec.js | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/widget/input.js b/src/widget/input.js index 7f1a5773..ec9701e7 100644 --- a/src/widget/input.js +++ b/src/widget/input.js @@ -414,8 +414,8 @@ angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER')); * * @param {string} ng:model Assignable angular expression to data-bind to. * @param {string=} name Property name of the form under which the widgets is published. - * @param {string=} true-value The value to which the expression should be set when selected. - * @param {string=} false-value The value to which the expression should be set when not selected. + * @param {string=} ng:true-value The value to which the expression should be set when selected. + * @param {string=} ng:false-value The value to which the expression should be set when not selected. * @param {string=} ng:change Angular expression to be executed when input changes due to user * interaction with the input element. * @@ -432,7 +432,7 @@ angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER'));
Value1:
Value2:
+ ng:true-value="YES" ng:false-value="NO">
value1 = {{value1}}
value2 = {{value2}}
@@ -453,8 +453,8 @@ angularInputType('integer', numericRegexpInputType(INTEGER_REGEXP, 'INTEGER')); */ angularInputType('checkbox', function(inputElement) { var widget = this, - trueValue = inputElement.attr('true-value'), - falseValue = inputElement.attr('false-value'); + trueValue = inputElement.attr('ng:true-value'), + falseValue = inputElement.attr('ng:false-value'); if (!isString(trueValue)) trueValue = true; if (!isString(falseValue)) falseValue = false; diff --git a/test/widget/inputSpec.js b/test/widget/inputSpec.js index 26e99a64..a4fc86aa 100644 --- a/test/widget/inputSpec.js +++ b/test/widget/inputSpec.js @@ -256,13 +256,13 @@ describe('widget: input', function() { it('should allow custom enumeration', function() { - compile(''); + compile(''); - scope.name='ano'; + scope.name='y'; scope.$digest(); expect(scope.$element[0].checked).toBe(true); - scope.name='nie'; + scope.name='n'; scope.$digest(); expect(scope.$element[0].checked).toBe(false); @@ -271,10 +271,10 @@ describe('widget: input', function() { expect(scope.$element[0].checked).toBe(false); browserTrigger(element); - expect(scope.name).toEqual('ano'); + expect(scope.name).toEqual('y'); browserTrigger(element); - expect(scope.name).toEqual('nie'); + expect(scope.name).toEqual('n'); }); -- cgit v1.2.3