soma-template icon indicating copy to clipboard operation
soma-template copied to clipboard

data-enabled attribute

Open motatoes opened this issue 8 years ago • 0 comments

It would be nice to have a data-enabled attribute which is the negation of the data-disabled attribute. This will make the code more logical when tieing it to a boolean variable that determines whether or not a boolean attribute is enabled. For example:

 Agree to terms and conditions: 
 <input type="checkbox" data-checked="{{termsAndConditionsChecked}}" >
 <input type="text" data-enabled="{{termsAndConditionsChecked}}" >

And in the template

var template = function(scope) {
    scope.termsAndConditions = false;
}

This will avoid having to do a negation for the variable as would be the case for the data-disabled attribute. Happy to work on a PR for this "feature" if needed ..

motatoes avatar Nov 13 '16 15:11 motatoes