aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMisko Hevery2011-02-07 15:15:14 -0800
committerMisko Hevery2011-02-16 00:48:22 -0500
commite2154cbc0b9265bea04ce328879d4e9bf1c67c51 (patch)
treefd49a2d08f54b72997872e190ba9300f80c14a15 /src
parent0a5c00abf8664fdbdc5d16b13adb1989b4531cdf (diff)
downloadangular.js-e2154cbc0b9265bea04ce328879d4e9bf1c67c51.tar.bz2
remove dom manipulation API from compiler
Diffstat (limited to 'src')
-rw-r--r--src/Angular.js5
-rw-r--r--src/Compiler.js3
-rw-r--r--src/markups.js4
-rw-r--r--src/widgets.js2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/Angular.js b/src/Angular.js
index 9a1ab4a2..f9047d32 100644
--- a/src/Angular.js
+++ b/src/Angular.js
@@ -273,7 +273,10 @@ function jqLiteWrap(element) {
if (element) {
if (isString(element)) {
var div = document.createElement('div');
- div.innerHTML = element;
+ // Read about the NoScope elements here:
+ // http://msdn.microsoft.com/en-us/library/ms533897(VS.85).aspx
+ div.innerHTML = '<div>&nbsp;</div>' + element; // IE insanity to make NoScope elements work!
+ div.removeChild(div.firstChild); // remove the superfluous div
element = new JQLite(div.childNodes);
} else if (!(element instanceof JQLite)) {
element = new JQLite(element);
diff --git a/src/Compiler.js b/src/Compiler.js
index d1505404..804a9622 100644
--- a/src/Compiler.js
+++ b/src/Compiler.js
@@ -178,9 +178,6 @@ Compiler.prototype = {
template,
selfApi = {
compile: bind(self, self.compile),
- comment:function(text) {return jqLite(document.createComment(text));},
- element:function(type) {return jqLite(document.createElement(type));},
- text:function(text) {return jqLite(document.createTextNode(text));},
descend: function(value){ if(isDefined(value)) descend = value; return descend;},
directives: function(value){ if(isDefined(value)) directives = value; return directives;},
scope: function(value){ if(isDefined(value)) template.newScope = template.newScope || value; return template.newScope;}
diff --git a/src/markups.js b/src/markups.js
index 89cc0d05..99e1cca7 100644
--- a/src/markups.js
+++ b/src/markups.js
@@ -38,10 +38,10 @@ angularTextMarkup('{{}}', function(text, textNode, parentElement) {
forEach(parseBindings(text), function(text){
var exp = binding(text);
if (exp) {
- newElement = self.element('span');
+ newElement = jqLite('<span>');
newElement.attr('ng:bind', exp);
} else {
- newElement = self.text(text);
+ newElement = jqLite(document.createTextNode(text));
}
if (msie && text.charAt(0) == ' ') {
newElement = jqLite('<span>&nbsp;</span>');
diff --git a/src/widgets.js b/src/widgets.js
index f8efae60..7438254d 100644
--- a/src/widgets.js
+++ b/src/widgets.js
@@ -890,7 +890,7 @@ angularWidget('a', function() {
*/
angularWidget("@ng:repeat", function(expression, element){
element.removeAttr('ng:repeat');
- element.replaceWith(this.comment("ng:repeat: " + expression));
+ element.replaceWith(jqLite("<!-- ng:repeat: " + expression + " --!>"));
var template = this.compile(element);
return function(reference){
var match = expression.match(/^\s*(.+)\s+in\s+(.*)\s*$/),