Angular 2 How to “watch” for tab changes

前端 未结 5 1401
一生所求
一生所求 2020-12-10 00:52

I have:


  
    

Some tab content

5条回答
  •  没有蜡笔的小新
    2020-12-10 01:22

    You can use ngKeypress ( Angular Documentation here) into any HTML tag. For example:

      
    
    yourFunction(evt){
       if(evt.code === "Tab"){
          //Do your stuff
       }
    }
    

提交回复
热议问题