From 77a42c462893f9fffb22fec72ddae2b638193f12 Mon Sep 17 00:00:00 2001 From: DAB0mB Date: Mon, 25 Apr 2016 00:23:59 +0300 Subject: [PATCH] Step 4.2: Add chat controller --- src/controllers/chat.controller.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/controllers/chat.controller.js diff --git a/src/controllers/chat.controller.js b/src/controllers/chat.controller.js new file mode 100644 index 0000000..a37f0cd --- /dev/null +++ b/src/controllers/chat.controller.js @@ -0,0 +1,20 @@ +import { Chats } from 'api/collections'; +import { Controller } from 'angular-ecmascript/module-helpers'; + +export default class ChatCtrl extends Controller { + static $inject = ['$stateParams'] + + constructor() { + super(...arguments); + + this.chatId = this.$stateParams.chatId; + + this.helpers({ + data() { + return Chats.findOne(this.chatId); + } + }); + } +} + +ChatCtrl.$name = 'ChatCtrl'; \ No newline at end of file