show/hide password text using angular2

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

    You need to use ViewChild() instead of ContentChild()

    @ViewChild(ShowHideInput) input: ShowHideInput;
    

    check your plunk

    ContentChild() is for matching inside the transcluded content. e.g. contents inside

提交回复
热议问题