Ng-Readonly-4

 

We can enable the email textbox when we select the current date which is bind to date variable and pass as parameter in calculation(date) function which is called on ng-change directive.

 
 
 
<!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>Read email field (range should greater then 70): <input type="range" ng-model="rg" ng-change="calculation(rg)"></label><br /> Email:<input ng-readonly="!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