I have two separate views:
- List of posts
- List of comments connected with particular post
When I click on particular post in #1 view I'm displaying #2 view using simple transitionTo('comments', post). What I want to do is to mark all comments connected with the post as read when they are displayed. Let's say I want to run method: markAllAsRead(comment). Where I should put this business logic?
The ideal would be to add some hook to controller on loading. Can't find anything like this, init method is called only on first load of #2 view.
I can also run this in router in setupController
App.IndexRoute = Ember.Route.extend({
setupControler: function(controller, model){
this._super(controller, model);
markAllAsRead(model);
}
});
But it router doesn't seems to be designed to keep such logic.