fixed build

This commit is contained in:
Misko Hevery 2010-07-15 14:16:04 -07:00
parent 1de82283db
commit 7cef4358ae
4 changed files with 20 additions and 9 deletions

View file

@ -34,7 +34,7 @@ foreach({
return text;
},
'date': function(amount) {
'date': function(date) {
},
'json': function(object) {

View file

@ -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;
}

View file

@ -1,3 +1,7 @@
beforeEach(function(){
compileCache = {};
});
describe('Angular', function(){
xit('should fire on updateEvents', function(){
var onUpdateView = jasmine.createSpy();

View file

@ -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'});