Object keys with "-" need to use string notation:
{{ {'video-hero': videoHero} | tokenList}}
On Thu, Dec 11, 2014 at 2:21 PM, Sam Carecho <[email protected]> wrote:
> Thank you Eric :)
>
>
> But I'm still doing something wrong.
> Regarding the declaration of the attribute "someAttribute", I got it wrong
> while typing the sample code that was based on the actual app code.
>
> Sorry for taking all this time from you, but please, can you take a look
> on this extraction of the actual code to help me identify why the
> expression is not working?
>
> http://jsbin.com/lifalabuhe/1/edit?html,output
>
>
> Cheers,
> Sam
>
> On Thu, Dec 11, 2014 at 7:40 PM, Eric Bidelman <[email protected]> wrote:
>
>> Whoops. Here it is: http://jsbin.com/qaberudasa/1/edit?html,output
>>
>> On Thu, Dec 11, 2014 at 1:38 PM, Sam Carecho <[email protected]> wrote:
>>
>>> Eric,
>>>
>>> Thanks for the reply :) , but the jsbin link leads to a default jsbin,
>>> no code there, just a HTML default template.
>>>
>>>
>>> Cheers,
>>> Sam
>>>
>>> On Thu, Dec 11, 2014 at 7:31 PM, Eric Bidelman <[email protected]> wrote:
>>>
>>>> That element definition doesn't match your <my-tag
>>>> someAttribute></my-tag> declaration.
>>>>
>>>> You want: http://jsbin.com/?html,output
>>>>
>>>> On Thu, Dec 11, 2014 at 1:25 PM, Sam Carecho <[email protected]>
>>>> wrote:
>>>>
>>>>> Eric and fellows,
>>>>>
>>>>>
>>>>> It's not working for me.
>>>>>
>>>>> I was using javascript's "classList" "add()" and "remove()" methods to
>>>>> change the classes of the elements within the shadow DOM.
>>>>> After reading this thread I changed my code to use Polymer
>>>>> Expressions, but it seems that I'm doing something wrong,
>>>>>
>>>>> Can you or someone lend a little hand?
>>>>>
>>>>> Here is my code:
>>>>>
>>>>> --> the custom element tag:
>>>>>
>>>>>> <my-tag someAttribute></my-tag>
>>>>>
>>>>>
>>>>>
>>>>> --> the custom element definition:
>>>>>
>>>>>> <polymer-element name="my-tag" attributes="notitle author">
>>>>>> <template>
>>>>>> <div id="someId" class="{{ {someClass: someAttribute} |
>>>>>> tokenList}}"></div>
>>>>>> </template>
>>>>>> <script>
>>>>>> Polymer({
>>>>>> author: this.author,
>>>>>> ready: function() { }
>>>>>> });
>>>>>> </script>
>>>>>> </polymer-element>
>>>>>
>>>>>
>>>>>
>>>>> Thanks,
>>>>> Sam
>>>>>
>>>>> On Thu, Dec 11, 2014 at 6:43 PM, Eric Bidelman <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> The syntax changed, but same general idea:
>>>>>>
>>>>>> <div class="{{ {active: user.selected, big: user.type == 'super'} |
>>>>>> tokenList}}">
>>>>>>
>>>>>>
>>>>>> https://www.polymer-project.org/docs/polymer/expressions.html#tokenlist
>>>>>>
>>>>>> On Thu, Dec 11, 2014 at 11:12 AM, <[email protected]> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Just wondering does this solution still work in Polymer version
>>>>>>> 0.5.1? I seem to have no luck with it....
>>>>>>>
>>>>>>> <div class="{{ active: user.selected}}">
>>>>>>>
>>>>>>>
>>>>>>> If not, could someone tell me the correct way to approach this?
>>>>>>>
>>>>>>> Thanks, Willem
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Monday, June 24, 2013 3:59:03 PM UTC+1, Eric Bidelman wrote:
>>>>>>>>
>>>>>>>> No problem. There's lot-o-good stuff in there.
>>>>>>>>
>>>>>>>> I've added
>>>>>>>> <https://github.com/Polymer/mdv/commit/4d4966dce26da9c7168d5d9359b05c1f18e62206>
>>>>>>>> a link from the main MDV docs to the Expression Syntax doc.
>>>>>>>> Hopefully it will be easier to find next time we publish docs.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Jun 24, 2013 at 7:54 AM, Martijn Faassen <
>>>>>>>> [email protected]> wrote:
>>>>>>>>
>>>>>>>>> Hi Eric,
>>>>>>>>>
>>>>>>>>> Thanks, I should read that document carefully. That looks like a
>>>>>>>>> nice solution!
>>>>>>>>>
>>>>>>>>> I see it also answers a question I had about accessing an outer
>>>>>>>>> scope
>>>>>>>>> object in an inner scope. Awesome!
>>>>>>>>>
>>>>>>>>> Regards,
>>>>>>>>>
>>>>>>>>> Martijn
>>>>>>>>>
>>>>>>>>
>>>>>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>>>>>> ---
>>>>>>> You received this message because you are subscribed to the Google
>>>>>>> Groups "Polymer" group.
>>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>>> send an email to [email protected].
>>>>>>> To view this discussion on the web visit
>>>>>>> https://groups.google.com/d/msgid/polymer-dev/e0b3f7e7-2b3c-446d-bebd-e00f926b46d9%40googlegroups.com
>>>>>>> <https://groups.google.com/d/msgid/polymer-dev/e0b3f7e7-2b3c-446d-bebd-e00f926b46d9%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>>>> .
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>> Follow Polymer on Google+: plus.google.com/107187849809354688692
>>>>>> ---
>>>>>> You received this message because you are subscribed to the Google
>>>>>> Groups "Polymer" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it,
>>>>>> send an email to [email protected].
>>>>>> To view this discussion on the web visit
>>>>>> https://groups.google.com/d/msgid/polymer-dev/CACGqRCBSV%2Bagg3nErKYDL1%3Dhk61MCZ1OM9%2Bm3%3D9s76BLpOz%3D%3DA%40mail.gmail.com
>>>>>> <https://groups.google.com/d/msgid/polymer-dev/CACGqRCBSV%2Bagg3nErKYDL1%3Dhk61MCZ1OM9%2Bm3%3D9s76BLpOz%3D%3DA%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>>> .
>>>>>>
>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups
"Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/polymer-dev/CACGqRCA5B0rb7bBSXvBXq6z84QckkqcQxKX8DOmCtPm41UR7Nw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.