dulgan dulgan - 1 year ago 82
AngularJS Question

How to display the first data in ng-repeat?

How to display the first data in ng-repeat

<div class = "panel-body">
<div ng-repeat=" img in images">
<img src="http://photo/{{img.path}}" alt="">
Panel content

example sql
SELECT TOP 1 * FROM Customers;

Answer Source

Use ng-if="$index == 0"

See below

<img ng-if="$index == 0" ng-src="http://photo/{{img.path}}" alt="" />
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download