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

The example for using ng-readonly and ng-disabled

<!doctype html>
<html lang="en" ng-app="">
    <meta charset="UTF-8">
    <title>how to disable and read-only text-box in angularjs?</title>
    <script src="//"></script>
<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="" />
    <button ng-disabled={{isDisabled}}>Button</button>


The output go to link

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 - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
Post a Comment Powered by Blogger.
ASK Questions