mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-14 01:33:11 +00:00
fixing css class name for currency filter and its spec
This commit is contained in:
parent
7059579c74
commit
4bef371e5a
2 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
angularFilter.currency = function(amount){
|
angularFilter.currency = function(amount){
|
||||||
this.$element.toggleClass('ng:format-negative', amount < 0);
|
this.$element.toggleClass('ng-format-negative', amount < 0);
|
||||||
return '$' + angularFilter['number'].apply(this, [amount, 2]);
|
return '$' + angularFilter['number'].apply(this, [amount, 2]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,11 @@ describe('filter', function(){
|
||||||
var currency = bind(context, filter.currency);
|
var currency = bind(context, filter.currency);
|
||||||
|
|
||||||
assertEquals(currency(0), '$0.00');
|
assertEquals(currency(0), '$0.00');
|
||||||
assertEquals(html.hasClass('ng:format-negative'), false);
|
assertEquals(html.hasClass('ng-format-negative'), false);
|
||||||
assertEquals(currency(-999), '$-999.00');
|
assertEquals(currency(-999), '$-999.00');
|
||||||
assertEquals(html.hasClass('ng:format-negative'), true);
|
assertEquals(html.hasClass('ng-format-negative'), true);
|
||||||
assertEquals(currency(1234.5678), '$1,234.57');
|
assertEquals(currency(1234.5678), '$1,234.57');
|
||||||
assertEquals(html.hasClass('ng:format-negative'), false);
|
assertEquals(html.hasClass('ng-format-negative'), false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue