Skip to content

Commit

Permalink
add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
quoctran18 committed Oct 2, 2017
1 parent 67b8c5c commit ecf0829
Show file tree
Hide file tree
Showing 28 changed files with 1,173 additions and 197 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
.module('articles')
.controller('CreateArticlesAdminController', CreateArticlesAdminController);

CreateArticlesAdminController.$inject = ['$scope', '$state', '$window', 'articleResolve', 'Authentication', 'Notification', '$stateParams'];
CreateArticlesAdminController.$inject = ['$scope', '$state', '$window', 'articleResolve', 'Authentication', 'Notification', '$stateParams', 'menuService'];

function CreateArticlesAdminController($scope, $state, $window, article, Authentication, Notification, $stateParams) {
function CreateArticlesAdminController($scope, $state, $window, article, Authentication, Notification, $stateParams, menuService) {
var vm = this;
vm.article = article;
vm.authentication = Authentication;
Expand Down Expand Up @@ -59,13 +59,20 @@
}

vm.article.content = vm.content.getData();
vm.article.project = $state.params.projectId;
vm.article.project = { _id: $state.params.projectId };
vm.article.folder = $state.params.folderId;
vm.article.createOrUpdate()
.then(successCallback)
.catch(errorCallback);

function successCallback(res) {
menuService.updateMenuItem('sidebar', {
title: res.project.name,
state: 'projects.view',
id: res.project._id,
params: { name: 'projectId', id: res.project._id },
roles: ['*']
});
if ($state.params.folderId) {
$state.go('folders.view', {
projectId: $state.params.projectId,
Expand Down
Loading

0 comments on commit ecf0829

Please sign in to comment.