feat(forums): init forum post new topic page view & client controller

This commit is contained in:
OldHawk
2017-07-06 18:03:35 +08:00
parent ea5c54fdb5
commit 233c2bb13b
2 changed files with 72 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
(function () {
'use strict';
angular
.module('forums')
.controller('ForumsPostController', ForumsPostController);
ForumsPostController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'SideOverlay', '$filter', 'NotifycationService',
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService'];
function ForumsPostController($scope, $state, $translate, Authentication, MeanTorrentConfig, ForumsService, SideOverlay, $filter, NotifycationService,
marked, ModalConfirmService, $stateParams, TopicsService) {
var vm = this;
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
vm.user = Authentication.user;
/**
* init
*/
vm.init = function () {
// get forum info by state params
ForumsService.get({
forumId: $stateParams.forumId
}, function (item) {
console.log(item);
vm.forum = item;
vm.forumPath = [
{name: vm.forum.name, state: 'forums.view', params: {forumId: vm.forum._id}},
{name: 'Post New Topic', state: undefined}
];
});
};
}
}());