angular.module('ngPartial', []).directive('ngPartial', function ($http, $templateCache, $compile, $parse) {
  return {
    restrict: 'ECA',
    terminal: true,
    compile: function (element, attr) {
      var srcExp = attr.ngPartial || attr.src,
        onloadExp = attr.onload || '';

      return function (scope, element) {
        var changeCounter = 0,
          childScope;

        var clearContent = function () {
          if (childScope) {
            childScope.$destroy();
            childScope = null;
          }

          element.html('');
        };

        scope.$watch(srcExp, function ngIncludeWatchAction(value) {
          var thisChangeId = ++changeCounter;
          console.log('value', value);

          if (value) {
            if (value.indexOf('@') === 0) {
              var href = value.substr(1);
              $http.get(href, {cache: $templateCache}).success(function (response) {
                if (thisChangeId !== changeCounter) return;

                if (childScope) childScope.$destroy();
                childScope = scope.$new();
                console.log('childScope', childScope);

                element.html(response);
                $compile(element.contents())(childScope);

                childScope.$emit('$includeContentLoaded');
                scope.$eval(onloadExp);
              }).error(function () {
                  if (thisChangeId === changeCounter) clearContent();
                });
            }
            else {
              console.log('da', value);
              if (thisChangeId !== changeCounter) return;
              console.log('dawa', value);

              if (childScope) childScope.$destroy();
              childScope = scope.$new();

              element.html(value);
              $compile(element.contents())(childScope);

              childScope.$emit('$includeContentLoaded');
              scope.$eval(onloadExp);
            }
          }
          else {
            clearContent();
          }
        });
      };
    }
  };
});
@@ -680,47 +680,8 @@
 ter;
-%0A          console.log('value', value);
 %0A%0A  
@@ -736,17 +736,17 @@
 Of('
-@
+/
 ') === 0
 ) %7B%0A
@@ -745,53 +745,40 @@
 == 0
-) %7B%0A              var href = value.substr(1);
+ %7C%7C value.indexOf('./') === 0) %7B
 %0A   
@@ -802,12 +802,13 @@
 get(
-href
+value
 , %7Bc
@@ -1022,63 +1022,8 @@
 w();
-%0A                console.log('childScope', childScope);
 %0A%0A  
@@ -1382,48 +1382,8 @@
 e %7B%0A
-              console.log('da', value);%0A
     
@@ -1439,50 +1439,8 @@
 urn;
-%0A              console.log('dawa', value);
 %0A%0A  

fix Angular demo