aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/compile.js
diff options
context:
space:
mode:
authordanilsomsikov2013-01-22 16:59:09 +0100
committerIgor Minar2013-02-25 21:44:00 -0800
commit398691beb3fc40a481afa258d181de06ec0d153c (patch)
tree1a86314e65a0778e80e3780d2b5ad6f9cd5e8df7 /src/ng/compile.js
parent7ddbde8c1c00e08a63de9701e29bf5e8bed051b8 (diff)
downloadangular.js-398691beb3fc40a481afa258d181de06ec0d153c.tar.bz2
fix($compile): compile replace directives in external template
Passing DOMNode#childNodes to compileNodes when compiling remote template, so that directives with replace:true can be compiled. The previous version used jqLite#contents which returned collection that was not updated during the compilation. Closes #1859
Diffstat (limited to 'src/ng/compile.js')
-rw-r--r--src/ng/compile.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ng/compile.js b/src/ng/compile.js
index f39b0935..48beb61e 100644
--- a/src/ng/compile.js
+++ b/src/ng/compile.js
@@ -358,7 +358,7 @@ function $CompileProvider($provide) {
function compile($compileNodes, transcludeFn, maxPriority) {
if (!($compileNodes instanceof jqLite)) {
- // jquery always rewraps, where as we need to preserve the original selector so that we can modify it.
+ // jquery always rewraps, whereas we need to preserve the original selector so that we can modify it.
$compileNodes = jqLite($compileNodes);
}
// We can not compile top level text elements since text nodes can be merged and we will
@@ -410,7 +410,7 @@ function $CompileProvider($provide) {
* functions return values - the linking functions - are combined into a composite linking
* function, which is the a linking function for the node.
*
- * @param {NodeList} nodeList an array of nodes to compile
+ * @param {NodeList} nodeList an array of nodes or NodeList to compile
* @param {function(angular.Scope[, cloneAttachFn]} transcludeFn A linking function, where the
* scope argument is auto-generated to the new child of the transcluded parent scope.
* @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then the
@@ -1000,7 +1000,7 @@ function $CompileProvider($provide) {
directives.unshift(derivedSyncDirective);
afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs, childTranscludeFn);
- afterTemplateChildLinkFn = compileNodes($compileNode.contents(), childTranscludeFn);
+ afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
while(linkQueue.length) {