1(function () { 2 'use strict'; 3 angular 4 .module('app') 5 .controller('EditArticleController', EditArticleController); 6 7 EditArticleController.$inject = ['$stateParams', '$state', 'newsService', 'modalService', 'confirmService']; 8 9 function EditArticleController($stateParams, $state, newsService, modalService, confirmService) { 10 var vm = this; 11 12 var articleId = parseInt($stateParams.id); 13 vm.buttonText = 'ÐмÑниÑи новинÑ'; 14 vm.manageArticle = editArticle; 15 16 17 activate(); 18 19 function activate() { 20 21 getArticle(); 22 } 23 24 vm.categories = newsService.data; 25 26 27 function getArticle() { 28 newsService.getArticle(articleId).then(function(response) { 29 vm.article = response.data; 30 }) 31 } 32 33 function editArticle() { 34 35 vm.article.catId = vm.selectedCat; 36 newsService.editArticle(vm.article).then(function(response) { 37 $state.go('dashboard.news'); 38 }); 39 } 40 41 } 42})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.