text: function BlogEditController(BlogService, $log, $routeParams) {
    var ctrl = this;
    ctrl.article = {};
    var id = $routeParams.id;
  
    this.$onInit = function() {
      BlogService.getPost(id)
        .then(function success(response){
          ctrl.post = response.data.post;
        });
    }
  
    ctrl.save = function(post) {
      BlogService.updatePost(post)
        .then(function success(response){
          window.location.reload();
        });
    }
  
  }
  
  BlogEditController.$inject = ['BlogService', '$log', '$routeParams'];
  
  angular.module('blog')
    .controller('BlogEditController', BlogEditController);