I am trying to just write jquery inside angularjs function.but don't know why it is not working?
HTML
<div>
<span ng-repeat="image in post.postImages" ng-if="$index <= 3" ng-init="image.showDeleteIcon= false" ng-mouseover="image.showDeleteIcon=true" ng-mouseleave="image.showDeleteIcon=false">
<span ng-if="$index == 3" ng-init="setImgCounter(post.postImages.length,$parent.$index+''+$index)"></span>
<a id="{{$parent.$index}}{{$index}}" onclick="SetDataGallery(this.id)" ng-href="../upload/post-photos/{{image.attachmentURL}}">
<img class="img-responsive feed-photo" ng-src="../upload/post-photos/{{image.attachmentURL}}" alt="Photo" style="display:inline;">
<a href="#" class="imgDelete" ng-if="post.timelineStrore.hasControl" ng-show="image.showDeleteIcon" title="Delete Photo" ng-click="DeletePostAttachment(post.timelineStrore.id, image.postAttachmentId,'image')">
<i class="fa fa-close"></i>
</a>
</a>
</span>
</div>
JS
$scope.setImgCounter = function (counter,id)
{
$("#" + id + " img:first-child").css("opacity", "0.5");
}
but its not working?
I also tried using =>
.att('style','opacity:0.5');
setImgCounter?$scope.$apply();after jquery code.