aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
authorMisko Hevery2010-03-22 15:46:34 -0700
committerMisko Hevery2010-03-22 15:46:34 -0700
commitb4561ff951ff452e55e820f6f8344dc2668cfd90 (patch)
treeca454e5edcf0fbe04a32ff9c950cce9be701e43b /src/Compiler.js
parent84552f7f8ac3f39c4dbd7d946ae2938d63302840 (diff)
downloadangular.js-b4561ff951ff452e55e820f6f8344dc2668cfd90.tar.bz2
ng-repeat works
Diffstat (limited to 'src/Compiler.js')
-rw-r--r--src/Compiler.js16
1 files changed, 15 insertions, 1 deletions
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)));
}
});