mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-28 01:00:59 +01:00
feat(forums): init forum topic list page view
This commit is contained in:
@@ -6,10 +6,10 @@
|
||||
.controller('ForumsViewController', ForumsViewController);
|
||||
|
||||
ForumsViewController.$inject = ['$scope', '$state', '$translate', 'Authentication', 'MeanTorrentConfig', 'ForumsService', 'SideOverlay', '$filter', 'NotifycationService',
|
||||
'marked', 'ModalConfirmService'];
|
||||
'marked', 'ModalConfirmService', '$stateParams', 'TopicsService'];
|
||||
|
||||
function ForumsViewController($scope, $state, $translate, Authentication, MeanTorrentConfig, ForumsService, SideOverlay, $filter, NotifycationService,
|
||||
marked, ModalConfirmService) {
|
||||
marked, ModalConfirmService, $stateParams, TopicsService) {
|
||||
var vm = this;
|
||||
vm.forumsConfig = MeanTorrentConfig.meanTorrentConfig.forumsConfig;
|
||||
vm.user = Authentication.user;
|
||||
@@ -18,10 +18,26 @@
|
||||
* init
|
||||
*/
|
||||
vm.init = function () {
|
||||
ForumsService.query({}, function (items) {
|
||||
vm.forums = items;
|
||||
});
|
||||
};
|
||||
// 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: undefined}
|
||||
];
|
||||
});
|
||||
|
||||
// get topics list
|
||||
TopicsService.query({
|
||||
forumId: $stateParams.forumId
|
||||
}, function (topics) {
|
||||
console.log(topics);
|
||||
vm.topics = topics;
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user