mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
remove dom manipulation API from compiler
This commit is contained in:
parent
0a5c00abf8
commit
e2154cbc0b
4 changed files with 7 additions and 7 deletions
|
|
@ -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> </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);
|
||||
|
|
|
|||
|
|
@ -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;}
|
||||
|
|
|
|||
|
|
@ -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> </span>');
|
||||
|
|
|
|||
|
|
@ -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*$/),
|
||||
|
|
|
|||
Loading…
Reference in a new issue