directive click outside angular 6

前端 未结 4 2184
广开言路
广开言路 2021-02-19 04:01

I upgraded my Angular from 4 to 6, and consequently had a problem with my click-off policy, it stopped working on all components.

my directive:



        
4条回答
  •  攒了一身酷
    2021-02-19 04:31

    You're referencing "this" in your template, which is not necessary. I made a working example of that directive:

    https://stackblitz.com/edit/angular-piqewb

    And theres no reason to have the directive on the div twice.

    {{ navTitle }}

提交回复
热议问题