From 36928858104ba793dfc7372dbaa28048123d6e63 Mon Sep 17 00:00:00 2001 From: TEHEK Firefox Date: Tue, 11 Oct 2011 22:37:00 +0000 Subject: fix(ng:options): compile null/blank option tag Fixes #562 --- src/Compiler.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Compiler.js') diff --git a/src/Compiler.js b/src/Compiler.js index 23bce084..1b079fc2 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -33,7 +33,14 @@ Template.prototype = { paths = this.paths, length = paths.length; for (i = 0; i < length; i++) { - children[i].link(jqLite(childNodes[paths[i]]), childScope); + // sometimes `element` can be modified by one of the linker functions in `this.linkFns` + // and childNodes may be added or removed + // TODO: element structure needs to be re-evaluated if new children added + // if the childNode still exists + if (childNodes[paths[i]]) + children[i].link(jqLite(childNodes[paths[i]]), childScope); + else + delete paths[i]; // if child no longer available, delete path } }, -- cgit v1.2.3