Skip to content

Commit

Permalink
feat(rxFormOptionTable): Add required attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
julianbonilla committed May 5, 2014
1 parent 84b2198 commit 646e875
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rxForm/rxForm.js
Expand Up @@ -157,6 +157,7 @@ angular.module('encore.ui.rxForm', ['ngSanitize'])
* @param {String} type - Type of input to be used
* @param {Object} model - Value to bind input to using ng-model
* @param {String} fieldId - Used for label and input 'id' attribute
* @param {String} required - Value passed to input's 'ng-required' attribute
*/
.directive('rxFormOptionTable', function ($interpolate) {
return {
Expand All @@ -168,7 +169,8 @@ angular.module('encore.ui.rxForm', ['ngSanitize'])
selected: '@',
type: '@',
model: '=',
fieldId: '@'
fieldId: '@',
required: '@'
},
controller: function ($scope) {
var determineMatch = function (val1, val2) {
Expand Down
2 changes: 2 additions & 0 deletions src/rxForm/templates/rxFormOptionTable.html
Expand Up @@ -17,12 +17,14 @@
value="{{row.value}}"
name="{{fieldId}}"
ng-disabled="isCurrent(row.value)"
ng-required="{{required}}"
>
<input type="checkbox"
ng-switch-when="checkbox"
id="{{fieldId}}_{{$index}}"
ng-model="$parent.model[$index]"
rx-attributes="{'ng-true-value': row.value, 'ng-false-value': row.falseValue}"
ng-required="{{required}}"
>
</th>
<td ng-repeat="column in columns">
Expand Down

0 comments on commit 646e875

Please sign in to comment.