I have a scope function that gets called and executed multiple times. How can i avoid this or how can I stop this?
<div class="row">
<label>Attached Documents</label>
<ion-scroll>
<img ng-repeat="image in detailedCaseInfo.real_estate_agent_assignment_attachments" ng-src='{{urlForImageDownload(image.filename)}}' ng-click="showImagesDetailed($index)" class="image-list-thumb" height="50px"/>
</ion-scroll>
</div>
$scope.urlForImageDownload = function(imageName) {
var name = imageName.substr(imageName.lastIndexOf('/') + 1);
console.log(name)
console.log(imageName)
var trueOrigin = AppSettings.baseApiUrl + imageName;
console.log(trueOrigin)
return trueOrigin;
}
I know it has to do something with databinding and $digest but i just cant figure out how to make it not execute multiple times.
Any help is appreciated