mardi 16 mai 2017

ember-cli-clipboard dynamic clipboardTarget

I’m using the ember-cli-clipboard wrapper to create a set of buttons within an ... loop that should copy a small text to the clipboard if you click it. Each element has its own text and its own button. Unfortunately I can not set the clipboardTarget with a dynamic ID, so the buttons will all copy only from the first element instead of copying from each single element.

The component looks like this:

<ul>
    

        
            <span class="name"></span>
        

    
</ul>

Instead of the clipboardTarget=".name" I would need something like a :

<ul>
    

        " success=(action 'copiedCharacter')}}
            <span id=""></span>
        

    
</ul>

Creating the ID is not the problem, but passing it inside the does not work... any suggestions?




Aucun commentaire:

Enregistrer un commentaire