Learn about ng-hide and ng-disabled and angularjsng-hide of angularjs.

Source: Internet
Author: User

Learn about ng-hide and ng-disabled and angularjsng-hide of angularjs.

1. There is a checkbox and a text box on the page. Whether the checkbox option can be used to input text in the text box:

 

<Input type = "checkbox" ng-model = "ckSwitch"/> <input id = "Text1" type = "text" ng-disabled = "! CkSwitch "ng-model =" textValue "/> Html Code

 

Demo:

 

2. If you want to hide the text box as soon as it is opened, the text box will be displayed only when the checkbox is clicked as true:

 

<Input type = "checkbox" ng-model = "ck1"/> <input type = "text" ng-hide = "! Ck1 "ng-model =" text1 "/> Html Code

 

Demo:

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.