show/hide password text using angular2

后端 未结 8 1519
爱一瞬间的悲伤
爱一瞬间的悲伤 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:27

    
     // Modify style as you need
    
     // variable
      show_button: Boolean = false;
      show_eye: Boolean = false;
    
    //Function
    showPassword() {
        this.show_button = !this.show_button;
        this.show_eye = !this.show_eye;
      }
    

提交回复
热议问题