Spent the whole day trying to figure this simple issue but no luck. I added ng-click to < a > tag but it's not calling the function. If I put the ng-click on a button, it works.
I've tried the following with no success.
<li><a href="#" ng-click="signout()">Sign Out</a></li>
<li><a href="" ng-click="signout()">Sign Out</a></li>
<li><a href ng-click="signout()">Sign Out</a></li>
<li><a ng-click="signout()">Sign Out</a></li>
<li ng-click="signout()"><a href="#">Sign Out</a></li>
I noticed though that when I click it, it adds the class ng-click-active
like this
<a href="#" ng-click="signout()" class="ng-click-active">Sign Out</a>
or like this
<li ng-click="signout()" class="ng-click-active"><a href="#">Sign Out</a></li>
I also noticed that ng-click on < a > tag will work if I execute this in the chrome dev tools console
$(document).foundation();
I'm out of ideas!
Update: I'm adding the js for the signout function
angular.module('myapp')
.controller('NavbarCtrl', function ($scope, $state, principal) {
$scope.signout = function() {
console.log('*******************');
principal.authenticate(null);
$state.go('login');
};
});