I've got a component called app-globals which for the moment only has javascript with a variable in it. When clicking a button I want to not only change the variable value, but bind that value to a number of places throughout the app.
I can't find any documentation for this.
Any help?
Asked
Active
Viewed 327 times
0
1 Answers
0
That question is already answered here: Polymer global variables
In short, use objects to store globals:
"By using an object with data properties, as in the edited version above, and only ever reading from and assigning to the data properties of that object rather than overwriting the object itself, changed values are shareable between instances."

Community
- 1
- 1

Goce Ribeski
- 1,352
- 13
- 30