how to display a textbox in disabled and read-only to textbox in angularjs?

How to use ng-readonly and ng-disabled in angularjs?

how to display a textbox in disabled and read-only in angularjs?

Hello everyone, I am going to share the code sample for display a textbox in readonly mode using ng-readonly attribute and disabled  to button using ng- disabled in angularjs as given below.

The click for live plunker demo http://embed.plnkr.co/fHqDy3/preview

The example for using ng-readonly and ng-disabled

<!doctype html>
<html lang="en" ng-app="">
<head>
    <meta charset="UTF-8">
    <title>how to disable and read-only text-box in angularjs?</title>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
</head>
<body ng-init="isDisabled = true">
    <h1>Check to checkbox for make readonly to the TextBox</h1>
    <input type="checkbox" ng-model="checked">Checked checkbox for Edit TextBox
    <input type="text" ng-readonly="!(checked)" value="www.code-sample.com" />
    <button ng-disabled={{isDisabled}}>Button</button>
</body>

</html>

The output go to link http://embed.plnkr.co/fHqDy3/preview
ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://www.code-sample.com and http://www.code-sample.xyz
My Books - Buy Books Online at Best Prices

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.