`this` in that context isn't and instance of Polymer.Base, but moltin.Product.
You'll need to bind the call your element object.

We typically don't recommend people use the array methods (push/splice/pop)
outside of their Polymer element. Is there a reason you can't just do:

moltinElement.product =  product;

in that callback and have your element handle adding objects to the spices
array?


On Sat, Aug 1, 2015 at 2:29 AM <[email protected]> wrote:

> Hi
> Im experienced dev (15 years +) but new to Polymer.
>
> I am stuck while i try and update an array with objects loaded in from
> external api.
>
> moltin.Authenticate( function() {
>
>   window.addEventListener( 'MoltinReady', function(response) {
>
>     moltin.Product.List({category:'11533901100405'}, function(product) {
>
>
>       for( obj in product ){
>         this.push('spices', obj)
>       }
>     });
>
>   });
>
> });
>
> Using polymer from bower and the issue reported in chrome is Uncaught
> TypeError: this.push is not a function - am i missing an import or
> something?
>
> 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/25c383bc-9c20-4e89-948f-bb3ef0e800e1%40googlegroups.com
> <https://groups.google.com/d/msgid/polymer-dev/25c383bc-9c20-4e89-948f-bb3ef0e800e1%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/CACGqRCDKTYzT6SGjtNy39AvRDTB_PfFoVRoEE7%2BuN1eWKHV1pA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to