Ng-Disable-5

 
In this example we have range and email field disabled by default. The email field will enable only when you exceed the range greater than 70.
 
 
 
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.2/angular.min.js"></script> </head> <body ng-app="app"> <div ng-controller="controllerName" ng-init="name='[email protected]'"> <label>Enable email field (range should greater then 70): <input type="range" ng-model="rg" ng-change="calculation(rg)"></label><br /> Email:<input ng-disabled="!isEnable" type="email" ng-model="name"> </div> <script> var app = angular.module("app", []); app.controller('controllerName', ['$scope', function ($scope) { $scope.calculation = function (rg) { $scope.isEnable = rg > 70 ? true : false; } }]); </script> </body> </html>
Output