I am using the plugin outlet composer-fields
to add a new text field to the compose window for a new topic. When the user clicks the “Create Topic” button I would like the data in that field to be stored as a custom field for the topic.
Under the “old” approach of extending a controller I am reasonably confident with doing this, but I am having difficulties using the new connector classes approach outlined in the post Important changes to Plugin Outlets for Ember 2.10.
In particular, I don’t know how to run code in response to the topic being created. I am guessing it is not an action, since the code execution is not being triggered in response to an action on that particular control. I am instead trying to observe model.createdPost
but cannot figure out how to get this working.
I have put this underneath setupComponent
in the connector class, but it never runs:
saveAfterCreating: function() {
console.log(createdPost);
}.observes('model.createdPost')
Any suggestions appreciated!
EDIT: Am I also somehow still able to reopen the ComposerController
to implement a save()
method, which I assume will be called automatically when the composer saves its content?
ComposerController.reopen({
actions: {
save() {
console.log("save");
}
}
})