Here is the element in question:
<a href="" ng-click="project.hasPhotos? removeFromProject(project, $index, currentPhoto) : addToProject($index, currentPhoto)" ng-class="{'selected-project': (belongsPhotoToProject(project, $index, currentPhoto) || project.hasPhotos)}">{{ project.label }}</a>
The purpose of the ng-class
directive is as follows: if the photo is associated with the project and the function belongsPhotoToProject
returns true
, the class selected-project
should be added. However, after clicking and executing the removeFromProject
function, which changes the output of belongsPhotoToProject
, the class is not removed as expected.
Therefore, I am left with a few questions: How does the ng-click
event behave after the initial page load? Is it possible to manually trigger the ng-click
event again when clicked?