I try execute a function at the same time of ng-repeat to be able use the index of the repeat itself. But in this moment only execute the last time.
<div ng-repeat="i in arraysemanas" ng-init="add_days($index)">
<a class="item item-icon-left fecha" href="#">
<i class="icon calendar"></i>
<p class="date_c">{{CurrentDate_1| date:' EEEE dd MMMM'}}</p>
</a>
</div>
In your template:
<div ng-repeat="i in arraysemanas">
<a class="item item-icon-left fecha" href="#">
<i class="icon calendar"></i>
<p class="date_c">{{CurrentDate_1| date:' EEEE dd MMMM'}}</p>
{{ add_days($index) }}
</a>
</div>
In your controller:
add_days(index) {
days += index; // or whatever you need to do
return '';
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With