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

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.