dimanche 20 décembre 2015

Change the image when clicked on it in ember

I a new to ember and trying to figure out a solution.I have a template which contains images.When I click on the images it should change the image.

applicaton.hbs

      <a href {{action "change"}}>
      <img src = "follow.png" /></a>

Controller.js

actions:{
    change() {
    src:"unfollow.png"
    },

How do I change the img tag source from "follow.png" to "unfollow" and vice-versa when I click on it.




Aucun commentaire:

Enregistrer un commentaire