There's an $index variable available within ng-repeat directives: 
see https://docs.angularjs.org/api/ng/directive/ngRepeat

Example:

    <div ng-repeat="item in items">
       <div>{{ myFunc($index) }}</div>
    </div>

On Saturday, July 12, 2014 5:48:08 PM UTC+2, Denis Ipatov wrote:
>
> How to execute function inside ng-repeat cycle with passing $index as 
> parametr and printing result to {{ }} part or somevhere within <div> block?
>
> The function like this:
>
>         $scope.myfunc = function (index ) {
>             return index * 2;
>         }
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to