angularjs - How to pass an Angular's value to a function -


i want call function fadeout() passing index number generated ng-repeat. tried this

   <img ng-src={{element.image}} class="portofolio-image"  id="portofolio-image{{$index}}"  ng-click="fadeout({{$index}})"> 

but there parsing error, , this

    <img ng-src={{element.image}} class="portofolio-image"  id="portofolio-image{{$index}}"  ng-click="fadeout('{{$index}}')"> 

which passes "{{$index}}" string. idea how can solve this?

you can use fadeout($index) follows:

    <img ng-src={{element.image}}       class="portofolio-image"       id="portofolio-image{{$index}}"       ng-click="fadeout($index)"> 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -