I have an issue, I am trying to hide an "i" element if a "span" contains a "div" element. the "span" contains text loaded via AJAX rendered as HTML that may or may not contain the "div class=difference"
the code looks something like this:
JAVASCRIPT:
$scope.hasChild = function() {
if ($('span.difference').has('div'))
return true;
else
return false;
};
HTML:
<ul ng-repeat="instance in value">
<li>
<i class="fa fa-warning" style="color: #ff6a00;" ng-if="hasChild()"></i>
<span class="difference" ng-bind-html="trustAsHtml(instance.Dati)"></span>
</li>
</ul>
it keeps always showing the warning icon
What am I doing wrong?