-
Notifications
You must be signed in to change notification settings - Fork 27.5k
support binding more "presence-only attributes" to an expression #694
Comments
Do I understand this correctly that you want to be able to bind to ng:required so that you can dynamically specify if a input field is required or not? If so then this is being addressed in https://github.com/mhevery/angular.js/commits/directive. |
Oh, great news. I'll close this ticket then. Please let me know if there's another ticket I can follow to track progress on this. Thanks! |
The change is part of a larger effort: https://github.com/angular/angular.js/issues?milestone=8 |
Cool, I'll follow that milestone, thanks. Thought of another html5 "presence-only" attribute: |
the presence-only attributes are officially called boolean attributes and with regards to autofocus, the html5 spec says that the focus should be so autofocus is quite tricky and requires special treatment. can you please |
Opened #698 to track autofocus, thanks. So does it make any sense to have a generic way of binding boolean attributes to an expression, so you can add arbitrary boolean attributes conditionally, or is there some way to do that already? |
thanks for creating the new issue. the thing is that some of these boolean attributes require special treatment - autofocus being a good example. So it's not just about expanding some vocabulary by adding new names to it. |
From e.g. the ng:checked docs:
The
ng:disabled
docs have something similar. But these aren't the only attributes whose mere presence (rather than value) determines behavior. Therequired
attribute of input elements (introduced in html5) is one example, and I don't see a way to bind its presence to the result of an expression. I see there'sng:required
, but it works differently, and begs the question (you'd have to bind its presence to an expression too). Is there currently some way to achieve this with therequired
attribute? With an arbitrary attribute?P.S. Thanks for the awesome work. Angular is amazing.
The text was updated successfully, but these errors were encountered: