aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMisko Hevery2010-07-15 14:16:04 -0700
committerMisko Hevery2010-07-15 14:16:04 -0700
commit7cef4358aea6f3cfa18dcfb8145d7bc0560bf157 (patch)
treea207997545bedbd86af6d1b68f573da7398f30aa
parent1de82283dbf1bed2fc04700584dc1123b1e159fe (diff)
downloadangular.js-7cef4358aea6f3cfa18dcfb8145d7bc0560bf157.tar.bz2
fixed build
-rw-r--r--src/filters.js2
-rw-r--r--src/jqLite.js17
-rw-r--r--test/AngularSpec.js4
-rw-r--r--test/directivesSpec.js6
4 files changed, 20 insertions, 9 deletions
diff --git a/src/filters.js b/src/filters.js
index 24464477..c8473af5 100644
--- a/src/filters.js
+++ b/src/filters.js
@@ -34,7 +34,7 @@ foreach({
return text;
},
- 'date': function(amount) {
+ 'date': function(date) {
},
'json': function(object) {
diff --git a/src/jqLite.js b/src/jqLite.js
index de1884a3..cff9ae00 100644
--- a/src/jqLite.js
+++ b/src/jqLite.js
@@ -37,11 +37,18 @@ function jqClearData(element) {
}
function getStyle(element) {
- var current = {}, style = element[0].style, value;
- for (var name in style) {
- value = style[name];
- if (1*name != name && name != 'cssText' && value && typeof value == 'string' && value !='false')
- current[name] = value;
+ var current = {}, style = element[0].style, value, name, i;
+ if (typeof style.length == 'number') {
+ for(i = 0; i < style.length; i++) {
+ name = style[i];
+ current[name] = style[name];
+ }
+ } else {
+ for (name in style) {
+ value = style[name];
+ if (1*name != name && name != 'cssText' && value && typeof value == 'string' && value !='false')
+ current[name] = value;
+ }
}
return current;
}
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index de724f03..6d462b14 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -1,3 +1,7 @@
+beforeEach(function(){
+ compileCache = {};
+});
+
describe('Angular', function(){
xit('should fire on updateEvents', function(){
var onUpdateView = jasmine.createSpy();
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index fb1e868a..dffc8906 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -73,12 +73,12 @@ describe("directives", function(){
});
it('should have $element set to current bind element', function(){
- var innerText;
+ var innerText = 'blank';
angularFilter.myFilter = function(text){
innerText = this.$element.text();
return text;
};
- var scope = compile('<div>before<div ng:bind-template="{{\'HELLO\'|myFilter}}">INNER</div>after</div>');
+ var scope = compile('<div>before<span ng:bind-template="{{\'HELLO\'|myFilter}}">INNER</span>after</div>');
expect(scope.$element.text()).toEqual("beforeHELLOafter");
expect(innerText).toEqual('INNER');
});
@@ -206,7 +206,7 @@ describe("directives", function(){
expect(element.hasClass('ng-exception')).toBeFalsy();
});
- it('should preserve and remove previus style', function(){
+ it('should preserve and remove previous style', function(){
var scope = compile('<div style="color:red;" ng:style="myStyle"></div>');
scope.$eval();
expect(getStyle(element)).toEqual({color:'red'});