show/hide password text using angular2

后端 未结 8 1340
爱一瞬间的悲伤
爱一瞬间的悲伤 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条回答
  •  -上瘾入骨i
    2021-02-15 12:18

    I see that in the approach from the question functionality is implemented directly in the component where the is and just for the record I want to share a more elegant approach - creating a component for the purpose

    Check the demo plunkr HERE, can be useful for others.

    Cheers!

提交回复
热议问题