如何在Angular2的某些div中只读所有输入? [英] How to make readonly all inputs in some div in Angular2?
本文介绍了如何在Angular2的某些div中只读所有输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含许多输入的页面,我想将其设为readOnly
"我找到了这个解决方案:如何改变Angular2 Typescript 中的 HTML 元素只读和必需属性?
I have a page with many inputs, and I want to make it 'readOnly
'
I find this solution: How to change HTML element readonly and required attribute in Angular2 Typescript?
但我不想为每个输入单独做.
But I don't want to do it for every input separately.
如何将 readOnly
属性添加到某个 div 中的所有输入.
How can I add readOnly
property to all inputs in some div.
推荐答案
在输入栏试试这个:
[readonly]="true"
希望,这会奏效.
这篇关于如何在Angular2的某些div中只读所有输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文