aboutsummaryrefslogtreecommitdiffstats
path: root/src/Compiler.js
diff options
context:
space:
mode:
authorMisko Hevery2010-10-26 22:02:24 -0700
committerMisko Hevery2010-10-27 15:42:46 -0700
commit62c0e5c46091d8b98a20c31ab26e715bad574bae (patch)
tree18e73b82cb9017b9e9b66d3ec094c53ce0b633a8 /src/Compiler.js
parentc67af8a03819004c4aaa775805badd1e631af738 (diff)
downloadangular.js-62c0e5c46091d8b98a20c31ab26e715bad574bae.tar.bz2
Fix failing tests for ie, and mark elements as ng-widget, ng-directive, and ng-binding
Diffstat (limited to 'src/Compiler.js')
-rw-r--r--src/Compiler.js13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/Compiler.js b/src/Compiler.js
index 9263dc02..b0210247 100644
--- a/src/Compiler.js
+++ b/src/Compiler.js
@@ -112,9 +112,11 @@ Compiler.prototype = {
templatize: function(element, elementIndex, priority){
var self = this,
widget,
+ fn,
directiveFns = self.directives,
descend = true,
directives = true,
+ elementName = nodeName(element),
template,
selfApi = {
compile: bind(self, self.compile),
@@ -138,12 +140,15 @@ Compiler.prototype = {
eachAttribute(element, function(value, name){
if (!widget) {
if (widget = self.widgets('@' + name)) {
+ element.addClass('ng-attr-widget');
widget = bind(selfApi, widget, value, element);
}
}
});
if (!widget) {
- if (widget = self.widgets(nodeName(element))) {
+ if (widget = self.widgets(elementName)) {
+ if (elementName.indexOf(':') > 0)
+ element.addClass('ng-widget');
widget = bind(selfApi, widget, element);
}
}
@@ -179,7 +184,11 @@ Compiler.prototype = {
});
});
eachAttribute(element, function(value, name){
- template.addInit((directiveFns[name]||noop).call(selfApi, value, element));
+ fn = directiveFns[name];
+ if (fn) {
+ element.addClass('ng-directive');
+ template.addInit((directiveFns[name]).call(selfApi, value, element));
+ }
});
}
// Process non text child nodes