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

css - I want to align grid in center -

Contact Form PHP Email Script -

python - SWIG function not printing output -