【发布时间】:2017-12-28 19:26:00
【问题描述】:
是否可以在 Angular 中使用代码更改 HTML 元素的属性?我有一个按钮,我希望它将输入的类型属性从密码更改为文本。最开始想到的是这样的:
模板:
<input name="password" type="password" />
<button click="showPassword()">eye</button>
组件:
showPassword() : void
{
//how do I change the password input to text input. Is there a better way to do this?
}
【问题讨论】:
标签: angular