I am using ng-repeat to display all the JSON data in list. However, I each of the data, some data consist of text data and some consist of image data. If it consist of image data, it will display of image and if it consist of text data, application is displaying text data. I am using ng-if condition to display either text data or image data. The following is my code.
html
<li ng-repeat="message in messages" ng-class="getClass(message.username)">
<div class="avatar"><img ng-src="{{image}}"
draggable="false"/></div>
<div class="msg">
<img ng-if="{{message.messageType}} =='image'" ng-src="img/adam.jpg"></img>
<p ng-if=" {{message.messageType}} =='text'">{{message.content}}</p>
<time>{{ message.date | date:"MM/dd/yyyy 'at' h:mma"}}<time>
</div>
</li>