aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/directives.js')
-rw-r--r--src/directives.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/directives.js b/src/directives.js
index 9aadbd11..994ef90e 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -27,14 +27,14 @@ angularDirective("ng:bind", function(expression){
var lastValue = noop, lastError = noop;
this.$onEval(function() {
var error, value, isHtml, isDomElement,
- oldElement = this.hasOwnProperty('$element') ? this.$element : undefined;
+ oldElement = this.hasOwnProperty($$element) ? this.$element : _undefined;
this.$element = element;
value = this.$tryEval(expression, function(e){
error = toJson(e);
});
this.$element = oldElement;
if (lastValue === value && lastError == error) return;
- isHtml = value instanceof HTML,
+ isHtml = value instanceof HTML;
isDomElement = isElement(value);
if (!isHtml && !isDomElement && isObject(value)) {
value = toJson(value);
@@ -76,7 +76,7 @@ function compileBindTemplate(template){
});
bindTemplateCache[template] = fn = function(element){
var parts = [], self = this,
- oldElement = this.hasOwnProperty('$element') ? self.$element : undefined;
+ oldElement = this.hasOwnProperty($$element) ? self.$element : _undefined;
self.$element = element;
for ( var i = 0; i < bindings.length; i++) {
var value = bindings[i].call(self, element);
@@ -85,7 +85,7 @@ function compileBindTemplate(template){
else if (isObject(value))
value = toJson(value, true);
parts.push(value);
- };
+ }
self.$element = oldElement;
return parts.join('');
};
@@ -133,7 +133,7 @@ angularDirective("ng:bind-attr", function(expression){
element.attr(key, value);
}
}
- };
+ }
}, element);
};
});
@@ -187,7 +187,7 @@ angularWidget("@ng:repeat", function(expression, element){
lastElement = childScope.$element;
index ++;
}
- };
+ }
// shrink children
while(children.length > index) {
children.pop().$element.remove();
@@ -242,7 +242,7 @@ angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;}));
angularDirective("ng:show", function(expression, element){
return function(element){
this.$onEval(function(){
- element.css('display', toBoolean(this.$eval(expression)) ? '' : 'none');
+ element.css($display, toBoolean(this.$eval(expression)) ? '' : $none);
}, element);
};
});
@@ -250,7 +250,7 @@ angularDirective("ng:show", function(expression, element){
angularDirective("ng:hide", function(expression, element){
return function(element){
this.$onEval(function(){
- element.css('display', toBoolean(this.$eval(expression)) ? 'none' : '');
+ element.css($display, toBoolean(this.$eval(expression)) ? $none : '');
}, element);
};
});
@@ -261,7 +261,7 @@ angularDirective("ng:style", function(expression, element){
this.$onEval(function(){
var style = this.$eval(expression) || {}, key, mergedStyle = {};
for(key in style) {
- if (resetStyle[key] === undefined) resetStyle[key] = '';
+ if (resetStyle[key] === _undefined) resetStyle[key] = '';
mergedStyle[key] = style[key];
}
for(key in resetStyle) {