Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4838

Disable a link-to for an action inside it

$
0
0

@emanuk wrote:

ember-cli: 2.14.2 node: 7.10.1

Hi there,

I have a component linked to an action inside a link-to.

The action of the component is to set a class of bouton to active when the user click on it.

Here a simple example of the code:

     //template
      {{#link-to "article-evenements" (query-params article=elem.nid)}}
            <img src="{{elem.image_vedette_mobile_portrait}}" alt="{{elem.title}}"/>
              {{compte-favori-bouton}}
      {{/link-to}}

    // component
   <div class="bouton-favori" {{action "selectionner"}}></div>`

The div bouton-favori look like a heart (see image)hart and is over the image. But when a user click on the heart, the heart has to change colour and the action is registered for later use. I don’t want the link to be active when a user clicks the heart.

I tried to set bubbles=false on the link-to or use a property as described here to no avail: https://emberjs.com/api/ember/2.14/classes/Ember.Templates.helpers/methods/action?anchor=action

I’m not sure how to handle the situation.

TIA

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4838

Trending Articles