|
<ejs-textbox id="password" width="190px" #default type="password" placeholder="Enter your Password" floatLabelType="Auto" required></ejs-textbox>
<style>
.e-input-eye:before {
content:'\e345';
font-family: e-icons;
font-size: 13px;
}
</style> |
|
export class AppComponent {
@ViewChild('default', {static: true})
public textbox: TextBoxComponent;
ngAfterViewInit() {
this.textbox.addIcon("append", "e-icons e-input-eye");
document.getElementsByClassName("e-input-eye")[0].addEventListener("click", function (e) {
let textObj: any = (document.getElementById("password") as any).ej2_instances[0];
if (textObj.element.type === "password") {
textObj.element.type = "text";
} else {
textObj.element.type = "password";
}
});
}
}
|
import { TextBox } from '@syncfusion/ej2-inputs'
let inputobj: TextBox = new TextBox({
placeholder: 'First Name',
floatLabelType: 'Auto',
buttons: [
{
cssClass: 'x',
...
},
{
...
}
]
});
inputobj.appendTo('#firstName');