aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
authorMisko Hevery2011-05-06 13:29:51 -0700
committerMisko Hevery2011-06-08 15:21:33 -0700
commit04a62e83bcd4067749fa5e2eb0181bc43500169c (patch)
treef8cd732f1ed44bd18308c4393c893e39190e9735 /src/Compiler.js
parentf9f95879f08073ce1170a471a925541324a0ff23 (diff)
downloadangular.js-04a62e83bcd4067749fa5e2eb0181bc43500169c.tar.bz2
Throw error when compiling multiple roots
Closes #338
Diffstat (limited to 'src/Compiler.js')
-rw-r--r--src/Compiler.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Compiler.js b/src/Compiler.js
index 08c76eea..f8d1e0f0 100644
--- a/src/Compiler.js
+++ b/src/Compiler.js
@@ -191,6 +191,11 @@ Compiler.prototype = {
var index = 0,
template,
parent = templateElement.parent();
+ if (templateElement.length > 1) {
+ // https://github.com/angular/angular.js/issues/338
+ throw Error("Cannot compile multiple element roots: " +
+ jqLite('<div>').append(templateElement.clone()).html());
+ }
if (parent && parent[0]) {
parent = parent[0];
for(var i = 0; i < parent.childNodes.length; i++) {