In the following stripped-down code example, shouldn't the
core-localstorage element load the value of the global js variable
`itemsApiURL' into {{value}}, so that it is passed into
my-datasource-element when that custom element is prepared? Or is the
purpose of core-localstorage limited to writing values to localstorage?
Currently, as is, {{value}} is undefined on my-datasource-element's
ready() event, despite it existing as a global variable (ideally set in an
external js config file, not included in head as shown here). I'm
definitely not doing something right...perhaps my lack of comfort with js,
or some sort of scoping/sequence of events issue.
Maybe there is an entirely better way to configure polymer app-wide
variables/constants, so that values can be easily used my all of the
applications elements, or at least passed around as element attributes via
2 way databinding? That is really the more important question here I
think...but either way I'm still confused as to how core-localstorage is
meant to operate.
<html>
<head>
<script>
this.itemsApiURL = "http://server:port/api/items";
</script>
<link rel="import" href="./components/platform/platform.js">
<link rel="import" href=
"./components/core-localstorage/core-localstorage.html">
</head>
<body fullbleed unresolved>
<template is="auto-binding">
<core-localstorage name="itemsApiURL" value="{{value}}"
></core-localstorage>
<my-datasource-element url="{{value}}" items="{{items}}"
><my-datasource-element>
</template>
</body>
</html>
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/7b9cb50e-fad1-468b-aa65-6c0d966cfc58%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.