show/hide password text using angular2

后端 未结 8 1368
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-15 11:53

i want to show/hide the password text based on the user click. But i am getting the following error saying:

export class App {
    password = \"secret\"         


        
8条回答
  •  无人共我
    2021-02-15 12:23

    //In HTML
    
    Show Password //In TS file passType: string = 'password'; changePasswordType(){ if(this.passType== 'password'){ this.passType= 'text' }else{ this.passType== 'password' } }

提交回复
热议问题