code: function markDirectiveScope(directives, isolateScope, newScope) {
        for (var j = 0, jj = directives.length; j < jj; j++) {
          directives[j] = inherit(directives[j], {$$isolateScope: isolateScope, $$newScope: newScope});
        }
      }
docs: Depending upon the context in which a directive finds itself it might need to have a new isolated or child scope created. For instance: * if the directive has been pulled into a template because another directive with a higher priority asked for element transclusion * if the directive itself asks for transclusion but it is at the root of a template and the original element was replaced. See https://github.com/angular/angular.js/issues/12936