Repository navigation
Upgrade your Component
Alright, so you're ready to re-invent the counter huh? That time-tested, honored and proven foundation of many a firework app - and you think you can do better? Awesome! Let's do some work...
Let's add an editable attribute to the counter called multiplier. It will be a number, with a minimum value of 1 and maximum value of 10. Later, we'll use it to multiply the current count. Make sure that this attribute is editable in the Appmaker designer by an app author, and that the value persists when you save and refresh the app. Set the default value to 2.
Docs: Component Attributes & Attributes & Polymer
Add a listener method called "Multiply Count". It will multiply the the current count by the multiplier attribute that you added earlier. Turn this listener on by default.
Add a broadcast method to the Counter called Click.
Add a click event to the component so that when it is clicked, it calls the Click broadcast method and broadcasts the current count. Use the special on-click shorthand.
Add a french translation for the multiplier attribute that you added.