Angularjs Examples

AJS Examples


AngularJS ng-Disabled Directive

The AngularJS ng-disabled directive is used to attach disabled attributes to the form element.

Syntax

<div ng-disabled="true"></div>

AngularJS ng-Disabled Directive Example

<html>
<head>
<title>My first AngularJS ng-disabled Directive code</title>
<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js">
</Script>
<Script>
//Defining Controller Using Standard Javascrip Object Constructor
function CustomerController($scope) {
	$scope.isDisabled = true;
	$scope.siteName = "www.TechStrikers.com";
}
</Script>
</head>
<body>
<div ng-app="">
<div ng-controller="CustomerController"> 

<input type="text" ng-disabled="isDisabled" ng-model="siteName">   

</div>
</div>
</body>
</html>
See live Example