Answer the question
In order to leave comments, you need to log in
How to hide div when outside is clicked?
Div, when clicked, we show the second div:
<div class="first pull-right h-btn" data-ng-if="user" data-ng-click="viewModel.showLogout = !viewModel.showLogout">
<div class="second" data-ng-if="viewModel.showLogout" data-ng-click="logout()">
<a href="javascript:void(0)">Log out</a>
</div>
Answer the question
In order to leave comments, you need to log in
If I deciphered you correctly, then you need it? jsfiddle.net/Baskerville42/ex03v2j2
<div ng-app>
<div ng-click="Ctrl.showLogout = !Ctrl.showLogout">Певый div (Ctrl.showLogout = {{Ctrl.showLogout}})</div>
<div ng-if="!Ctrl.showLogout" class="second">Log out</div>
</div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question