text: function BlogNewController(BlogService, $log) {
    var ctrl = this;
  
    ctrl.save = function(post) {
      BlogService.newPost(post)
        .then(function success(response){
          $log.log("Successfully saved new post");
          $location.path("blogs/edit/" + post.slug);
        }, function error(response){
          $log.log("Error:" + response);
          ctrl.error = response;
        });
    };
  
  }
  
  BlogNewController.$inject = ['BlogService', '$log'];
  
  angular.module('blog')
    .controller('BlogNewController', BlogNewController);