On Monday, October 10, 2016 at 9:31:26 PM UTC+1, Rupert Smith wrote:
>
>
>
> On Monday, October 10, 2016 at 3:38:13 PM UTC+1, Peter Damoc wrote:
>>
>> I have already tried doing this but have run into troubles:
>>
>> Here is the topic where I have the code and the problem: 
>> https://groups.google.com/forum/#!topic/elm-discuss/QI6G6Pd5jPU
>>
>
> I have found you can set it like this:
>
>                 hostAttributes: {
>                     'value': '1',
>                 }, 
>
> as per
>
> https://www.polymer-project.org/1.0/docs/devguide/registering-elements
>
> but that ignores the value in the attribute and also does not set the 
> value in Elm.
>
> Starting to figure out the docs for Polymer - they don't seem very well 
> organized, diving into complex stuff right at the start when we just need 
> the basics. But I'm sure if we keep reading the devguide well get the 
> answers.
>
>
You can also use the promisingly named 'reflectToAttribute' like this:

                properties: {
                    value: {
                        type: Number,
                        value: 0,
                        notify: true,
                        reflectToAttribute: true
                    },
                }, 

Seems like it might do the trick. Unfortunately it causes a double update, 
as I clink increment it goes 1,2 2,2 3,2 4,2. Possibly Elm is rebuilding 
the DOM and setting it back to 2 each time, so perhaps Html.Keyed.node is 
required here.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to