Is there any way to know that an object exist or not in HTML. I have an object like this.
$scope.object = {name : 'usman', profession : 'developer'}
Now i want to know in Html if the object exist or not or does the object contain only a text like this .
$scope.object = "Usman";
Now there are my conditions.
<div ng-if="object">
<p>Object exist and have attributes</p>
</div>
<div ng-if="object">
<p>object contain only string no attributes exist</p>
</div>
I want to write a combine condition like this - that if the object has no attributes and contains only string then show the div.
Here it is .
<div ng-show="!objecthasnoattributes and objectOnlyContainsString">
<p>show this </p>
</div>
Now how can I do this ?