<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<body ng-app="">
Click here to make the input field readonly:<input type="checkbox" ng-model="all"><br>
<br>
<input type="text" ng-readonly="all">
</body>
</html>