Or you can add an additional attribute to your model, called, for example, 'refresh' (boolean), and each time you change some internal values, also change it just by setting refresh =! refresh, then you can observe only one attribute instead of many. This is a good case when your model includes several nested attributes.
Polymer('x-element', { observe: { 'model.refresh': 'modelUpdated' }, ready: function() { this.model = { title: this.noteTitle, text: this.noteText, slug: this.noteSlug, refresh: false }; }, modelUpdated: function(oldValue, newValue) { var value = Path.get('model.title').getValueFrom(this); }, buttonClicked: function(e) { this.model.title = 'Title'; this.model.text = 'Text'; this.model.slug = 'Slug'; this.model.refresh = !this.model.refresh; } });
source share