I have an emberjs app that is structured very much like the sample here: https://github.com/tildeio/bloggr-client
The question I have is that when the user clicks on a 'post' on the left, is there any event I can subscribe to in the post view/route/controller that i can tap into? A javascript library I'm using (gridster) requires some javascript to be run as the user switches from post to post. I've tried using didInsertElement but that doesn't seem to fire (using 1.0.5)
You can observe the PostController's content property. This can be done from anywhere that has access to the PostController. For example, from PostView:
App.PostView = Ember.View.extend({
templateName: 'post',
contentDidChange: function() {
console.log('content changed to: ', this.get('controller.content'));
}.observes('controller.content')
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With