Plugin Development: Beyond the Basics?

This might be a bit hand-wavey, but you could probably tap into the Ember component lifecycle here to perform requests once the page has loaded its components.

Something like

# discourse/components/some-component.js.es6
export default Ember.Component.extend({
  didInsertElement() {
    ajax('/globber/files').then((response) => {
      this.set('files', response.files)
    }
  }
}
2 个赞