I have following code:
<div ng-repeat="dateDetails in visitsDates | orderBy : dateDetails.date | filter : contactid | limitTo : 1">
<tr>
<td>Joint Work</td>
<td>{{dateDetails.joint_work}}</td>
</tr>
<tr>
<td>Gap</td>
<td><a href="" ng-click="gap(dateDetails.date)">Click Me</a></td>
</tr>
</div>
in above code, I have put ng-click, after which the function is called. But the function has to be called by default so as to populate one of the columns, which is not happening. the function 'gap' sets $scope.gap to the difference between today's date and the date passed to it. How should I fix the problem?
visitsDates
, use Array#map – Ilan Frumer Jun 12 '14 at 6:39