angularjs - Using Angular ng-attr for the disabled attribute -
i trying use ng-attr conditionally add attribute element. code this:
<label for="theid" ng-attr-disabled="{{true || undefined}}" class="control-label"> label </label>
what inspecting element this:
<label translate="" for="theid" ng-attr-disabled="{{true || undefined}}" class="control-label ng-scope" disabled="disabled"> label </label>
but expectation is:
<label translate="" for="theid" ng-attr-disabled="{{true || undefined}}" class="control-label ng-scope" disabled> label </label>
am wrong altogether how works?
thanks
i don't think should care it, in case. when value falsy, disabled
not present. when value truthy, present - , it's presence in html attributes (like required
on inputs, validation care presence required="false"
makes input required). example, can style dependent on attribute presence: mdn attribute selectors.
Comments
Post a Comment