'use strict';

/* global CartUtility */
module.exports = function($scope, $location, $anchorScroll, $dataService, $editorService) {
    CartUtility.log('CartBlogNewCtrl');

    $scope.aceEditor = $editorService.createEditor('markdown-edit', 'markdown-preview', CartUtility.getPureAbsUrlFromLocation($location));

    $scope.toggleToc = CartUtility.toggleToc;

    $scope.$on('$routeChangeStart', function() {
        // anchor link logic
        var prevHash = $location.hash();
        $location.hash(CartUtility.escapeAnchorName(prevHash));
        $anchorScroll();
        $location.hash(prevHash);
    });
};
@@ -398,24 +398,95 @@
 unction() %7B%0A
+        CartUtility.log('CartBlogNewCtrl $routeChangeStart entered!');%0A
         // a
@@ -539,24 +539,91 @@
 ion.hash();%0A
+        if (typeof prevHash === 'string' && prevHash !== '') %7B%0A    
         $loc
@@ -682,16 +682,20 @@
         
+    
 $anchorS
@@ -699,24 +699,28 @@
 orScroll();%0A
+    
         $loc
@@ -741,16 +741,26 @@
 vHash);%0A
+        %7D%0A
     %7D);%0A

Add status check.