mardi 24 février 2015

Javascript/AngularJS: How do I make click event trigger parent?


<div id="fb-button-container" style="width:20%; margin:auto;" data-ng-show="!isLoggedIn" data-ng-click="checkFacebookLoginState()">
<div class="fb-login-button" data-max-rows="1" data-size="medium" data-show-faces="false" data-auto-logout-link="false">Login with Facebook</div><!--data-ng-disabled="!facebookReady"-->
</div>


I have this code. I'm using Facebook Login plug-in.


The problem I got is that if I put data-ng-click straight on the fb-login-button click event is not triggered (probably because overriden by default Facebook's click event).


So I put it in the parent. But this way I have to click outside from the button to trigger it.


I was wondering: is there a way to forse "backpropagation" of click event from child (fb-login-button) to parent (fb-button-container)?


Thanks in advance


Aucun commentaire:

Enregistrer un commentaire