The angular way is shown in the angular docs :)
https://docs.angularjs.org/api/ng/directive/ngReadonly
Here is an example that they use:
<body> Check me to make text readonly: <input type="checkbox" ng-model="checked"><br/> <input type="text" ng-readonly="checked" value="I'm Angular"/> </body>
Basically, the angular way is to create a model object that will contain whether the input should be read-only, and then set this model object accordingly. The beauty of angular is that most of the time you do not need to do any manipulations with dom. You simply angular render the view the way your model is installed (let angular do the dom manipulations for you and keep your code clean).
So basically in your case you would like to do something like below or check out this working example.
<button ng-click="isInput1ReadOnly = !isInput1ReadOnly">Click Me</button> <input type="text" ng-readonly="isInput1ReadOnly" value="Angular Rules!"/>
testing123 Jun 23 '13 at 4:09 2013-06-23 04:09
source share