如何使角形为只读并使用“编辑"按钮使其可编辑? [英] How to make an angular form read only and make it editable with edit button?

查看:66
本文介绍了如何使角形为只读并使用“编辑"按钮使其可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使整个Angular表单变为只读,然后在单击编辑"时可进行编辑?

Is there a way to make the entire Angular form read only and then editable when clicking edit?

推荐答案

您可以按照当前答案/注释中的建议分别禁用所有表单元素,也可以将所有表单元素包装在<fieldset> (更多信息)标签,然后一步一步启用/禁用所有功能:

You can individually disable all the form elements as suggested in the current answer/comments, or you can wrap all of your form elements in a <fieldset> (more info) tag and then enable/disable everything in one step:

<form>
  <fieldset ng-disabled="myBooleanValue">
    <input type="text">
  </fieldset>
</form>

这篇关于如何使角形为只读并使用“编辑"按钮使其可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆