From bd530e225750e9b30b6300fc3d7447a5f1071667 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Wed, 2 May 2012 16:34:54 -0700 Subject: chore($compile): remove obsolete <> transclusion This stuff was never documented and is an accidental leftover from the time when the compiler was rewritten. If any code depends on this, it should be rewritten to use ngTransclude directive intead. --- src/ng/compile.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/ng/compile.js') diff --git a/src/ng/compile.js b/src/ng/compile.js index d0b6e749..17f49d68 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -127,7 +127,6 @@ function $CompileProvider($provide) { Suffix = 'Directive', COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, CLASS_DIRECTIVE_REGEXP = /(([\d\w\-_]+)(?:\:([^;]+))?;?)/, - CONTENT_REGEXP = /\<\\>/i, HAS_ROOT_ELEMENT = /^\<[\s\S]*\>$/; @@ -569,9 +568,7 @@ function $CompileProvider($provide) { assertNoDuplicate('template', templateDirective, directive, element); templateDirective = directive; - // include the contents of the original element into the template and replace the element - var content = directiveValue.replace(CONTENT_REGEXP, element.html()); - templateNode = jqLite(content)[0]; + templateNode = jqLite(directiveValue)[0]; if (directive.replace) { replaceWith(rootElement, element, templateNode); @@ -593,7 +590,7 @@ function $CompileProvider($provide) { ii = directives.length; } else { - element.html(content); + element.html(directiveValue); } } @@ -828,7 +825,6 @@ function $CompileProvider($provide) { $http.get(asyncWidgetDirective.templateUrl, {cache: $templateCache}). success(function(content) { - content = trim(content).replace(CONTENT_REGEXP, html); if (replace && !content.match(HAS_ROOT_ELEMENT)) { throw Error('Template must have exactly one root element: ' + content); } -- cgit v1.2.3