mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-05 13:44:42 +00:00
fixed build
This commit is contained in:
parent
1de82283db
commit
7cef4358ae
4 changed files with 20 additions and 9 deletions
|
|
@ -34,7 +34,7 @@ foreach({
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
|
||||||
'date': function(amount) {
|
'date': function(date) {
|
||||||
},
|
},
|
||||||
|
|
||||||
'json': function(object) {
|
'json': function(object) {
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,18 @@ function jqClearData(element) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStyle(element) {
|
function getStyle(element) {
|
||||||
var current = {}, style = element[0].style, value;
|
var current = {}, style = element[0].style, value, name, i;
|
||||||
for (var name in style) {
|
if (typeof style.length == 'number') {
|
||||||
value = style[name];
|
for(i = 0; i < style.length; i++) {
|
||||||
if (1*name != name && name != 'cssText' && value && typeof value == 'string' && value !='false')
|
name = style[i];
|
||||||
current[name] = value;
|
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;
|
return current;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
beforeEach(function(){
|
||||||
|
compileCache = {};
|
||||||
|
});
|
||||||
|
|
||||||
describe('Angular', function(){
|
describe('Angular', function(){
|
||||||
xit('should fire on updateEvents', function(){
|
xit('should fire on updateEvents', function(){
|
||||||
var onUpdateView = jasmine.createSpy();
|
var onUpdateView = jasmine.createSpy();
|
||||||
|
|
|
||||||
|
|
@ -73,12 +73,12 @@ describe("directives", function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should have $element set to current bind element', function(){
|
it('should have $element set to current bind element', function(){
|
||||||
var innerText;
|
var innerText = 'blank';
|
||||||
angularFilter.myFilter = function(text){
|
angularFilter.myFilter = function(text){
|
||||||
innerText = this.$element.text();
|
innerText = this.$element.text();
|
||||||
return 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(scope.$element.text()).toEqual("beforeHELLOafter");
|
||||||
expect(innerText).toEqual('INNER');
|
expect(innerText).toEqual('INNER');
|
||||||
});
|
});
|
||||||
|
|
@ -206,7 +206,7 @@ describe("directives", function(){
|
||||||
expect(element.hasClass('ng-exception')).toBeFalsy();
|
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>');
|
var scope = compile('<div style="color:red;" ng:style="myStyle"></div>');
|
||||||
scope.$eval();
|
scope.$eval();
|
||||||
expect(getStyle(element)).toEqual({color:'red'});
|
expect(getStyle(element)).toEqual({color:'red'});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue