Skip to content

Commit

Permalink
Step 4.8: Add messages helper to chat controller
Browse files Browse the repository at this point in the history
  • Loading branch information
DAB0mB authored and Dotan Simha committed Nov 22, 2016
1 parent af73f29 commit 94d5711
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/controllers/chat.controller.js
@@ -1,4 +1,4 @@
import { Chats } from 'api/collections';
import { Chats, Messages } from 'api/collections';
import { Controller } from 'angular-ecmascript/module-helpers';

export default class ChatCtrl extends Controller {
Expand All @@ -10,6 +10,9 @@ export default class ChatCtrl extends Controller {
this.chatId = this.$stateParams.chatId;

this.helpers({
messages() {
return Messages.find({ chatId: this.chatId });
},
data() {
return Chats.findOne(this.chatId);
}
Expand Down

0 comments on commit 94d5711

Please sign in to comment.