i know ng-class can add/remove 'classes' based on Angular variables or based on evaluated expressions. But if i want to say put an attribute like 'readonly' on an element based some variable in the controller, what is the simplest method. I wish a directive like 'ng-attr' exists.
1 Answer
for readonly you can use ngReadonly: https://docs.angularjs.org/api/ng/directive/ngReadonly
for more general solution check ngAttr: https://docs.angularjs.org/guide/interpolation