Skip to content

Commit

Permalink
Step 3.7: 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 23, 2016
1 parent c697ad8 commit 86f300b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/scripts/controllers/chat.controller.js
@@ -1,5 +1,5 @@
import { Controller } from 'angular-ecmascript/module-helpers';
import { Chats } from '../../../lib/collections';
import { Chats, Messages } from '../../../lib/collections';

export default class ChatCtrl extends Controller {
constructor() {
Expand All @@ -8,6 +8,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 86f300b

Please sign in to comment.