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

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -