Polymer / shop

The Shop app
https://shop.polymer-project.org/
986 stars 494 forks source link

ShopCategoryData.categories is read only #149

Closed flatmax closed 6 years ago

flatmax commented 6 years ago

Hi there,

Great app ... we are wanting to use it. We have come across the problem that ShopCategoryData.categories is read only.

For that reason, we can't overload the class and set ShopCategoryData.categories to what we need for our shop. We actually have to edit the shop-category-data.html file to put our shop categories into the app.

Anyone got workarounds for this ? We can't think of any beyond editing shop-category-data.html

Matt

jsilvermist commented 6 years ago

If you have a read-only property called categoryData, it can be set using:

this._setCategoryData(newVal);

This is the pattern used to set a read-only property, for more info, see: https://www.polymer-project.org/1.0/docs/devguide/properties#read-only

frankiefu commented 6 years ago

Thanks @jsilvermist for the answer.