fix($compile): compilation should not recurse into empty nodes

if a node doesn't have children then don't try to compile these non-existent children
This commit is contained in:
Igor Minar 2012-10-25 00:58:50 -07:00
parent 524c5c8b5d
commit 008a782bc8

View file

@ -380,7 +380,7 @@ function $CompileProvider($provide) {
? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement)
: null;
childLinkFn = (nodeLinkFn && nodeLinkFn.terminal)
childLinkFn = (nodeLinkFn && nodeLinkFn.terminal || !nodeList[i].childNodes.length)
? null
: compileNodes(nodeList[i].childNodes,
nodeLinkFn ? nodeLinkFn.transclude : transcludeFn);