This is my current ng-click:
ng-click="avatarMenu = !avatarMenu"
<div class="avatar"
ng-click="avatarMenu = !avatarMenu"
ng-class="{ active: avatarMenu }">
<img src="_sources/images/joe.png" title="settings" alt="user avatar" />
</div>
Now I want to create a $scope function that does something else when you click on that element, tried the following, but got errors:
ng-click="avatarMenu = !avatarMenu, getMenuClick('clicked')"
Also tried to move the animation/boolean logic into the function inside my app.js but got avatarMenu is not defined, guess since it's not on the HTML anymore:
$scope.avatarMenu = false;
$scope.avMenu = {};
$scope.avMenu.getMenuClick = function(the_id) {
avatarMenu = !avatarMenu
selectAddress(the_id);
};
How would you have both the animate/boolean login on there as well as the function?
$scope.avatarMenuinside the controller$scope.avatarMenu = !$scope.avatarMenu. Of course,avatarMenuis not defined - the controller is just a regular JS function and you don't havevar avatarMenu = false;there.