From b4561ff951ff452e55e820f6f8344dc2668cfd90 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Mon, 22 Mar 2010 15:46:34 -0700 Subject: ng-repeat works --- src/Compiler.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/Compiler.js') diff --git a/src/Compiler.js b/src/Compiler.js index 5c650204..ece44805 100644 --- a/src/Compiler.js +++ b/src/Compiler.js @@ -107,6 +107,20 @@ JQLite.prototype = { this.element.parentNode.insertBefore(jqLite(element).element, this.element.nextSibling); }, + hasClass: function(selector) { + var className = " " + selector + " "; + if ( (" " + this.element.className + " ").replace(/[\n\t]/g, " ").indexOf( className ) > -1 ) { + return true; + } + return false; + }, + + addClass: function( selector ) { + if (!this.hasClass(selector)) { + this.element.className += ' ' + selector; + } + }, + attr: function(name, value){ var e = this.element; if (isObject(name)) { @@ -201,7 +215,7 @@ Compiler.prototype = { exclusive = true; directiveQueue = []; } - directiveQueue.push(bind(selfApi, directive, value, element)); + directiveQueue.push(bindTry(selfApi, directive, value, element, errorHandlerFor(element))); } }); -- cgit v1.2.3