Are there any examples in Discourse of decorating a widget after an ajax request?

The only solution I’ve found so far is to switch to Component and use bufferedRender and to observe for changes in local variable, then call re-render.

export default Ember.Component.extend(bufferedRender({

  @on("init")
  _updateContent() {
    if (!this.get('content')) {
      ajax("/growfaq.json").then(data => {
        this.set('content', data);
      });
    }
  }

  @observes('content')
  _rerenderOnChange() {
    this.rerenderBuffer();
  },

  
}));

Also

1 Like