diff options
| -rw-r--r-- | src/widget/input.js | 10 | ||||
| -rw-r--r-- | 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')); <form name="myForm"> Value1: <input type="checkbox" ng:model="value1"> <br/> Value2: <input type="checkbox" ng:model="value2" - true-value="YES" false-value="NO"> <br/> + ng:true-value="YES" ng:false-value="NO"> <br/> </form> <tt>value1 = {{value1}}</tt><br/> <tt>value2 = {{value2}}</tt><br/> @@ -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('<input type="checkbox" ng:model="name" true-value="ano" false-value="nie"/>'); + compile('<input type="checkbox" ng:model="name" ng:true-value="y" ng:false-value="n">'); - 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'); }); |
