I have the following code, which is a template of directive:
<div ng-click="showDetails=true" ng-init="showDetails=false"> <div ng-show="showDetails"> <div ng-click="showDetails=false">X</div> </div> </div> When I click on the outer div, the inner div shows, but when I click on the 'X', it doesn't go away. When I rewrite the code, and use 'ng-mouseover' instead of 'ng-click', it works fine (i.e. first click makes the div appear, hovering over the 'X', makes it disappear):
<div ng-click="showDetails=true" ng-init="showDetails=false"> <div ng-show="showDetails"> <div ng-mouseover="showDetails=false">X</div> </div> </div> Anyone has a clue what might be the problem of 'ng-click' not working? Thank you