ng-readonly

Description

We can use ng-readonly to control readonly attribute.

Example

The following code shows how to ng-readonly.


<!doctype html>
<html ng-app="myApp">
<head>
  <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0-rc.3/angular.js"></script>
</head><!-- www . j av a  2s. com-->
<body>
  Type to make input readonly: <br/>
  <input type="text" ng-model="isReadOnly"><br/>
  <input type="text" ng-readonly="isReadOnly" value="Some text here"/>

  <script>
    angular.module('myApp', [])
  </script>

</body>
</html>

Click to view the demo





















Home »
  AngularJS »
    AngularJS Tutorial »




Introduction
Buildin Filters
Buildin Directives