mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
This reverts commit 2ebe4ccfb0.
This commit is contained in:
@@ -105,18 +105,6 @@ describe('AmountWidgetComponent', () => {
|
|||||||
expect(widget.placeholder).toBe('1234');
|
expect(widget.placeholder).toBe('1234');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should setup placeholder when enableDisplayBasedOnLocale is true', () => {
|
|
||||||
widget.enableDisplayBasedOnLocale = true;
|
|
||||||
widget.field = new FormFieldModel(null, {
|
|
||||||
readOnly: false,
|
|
||||||
placeholder: '1234',
|
|
||||||
currency: 'USD'
|
|
||||||
});
|
|
||||||
|
|
||||||
widget.ngOnInit();
|
|
||||||
expect(widget.placeholder).toBe('$1,234');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('it should return locale based on browser', () => {
|
it('it should return locale based on browser', () => {
|
||||||
const expectedLanguage = 'en-US';
|
const expectedLanguage = 'en-US';
|
||||||
widget.enableDisplayBasedOnLocale = true;
|
widget.enableDisplayBasedOnLocale = true;
|
||||||
|
|||||||
@@ -75,10 +75,7 @@ export class AmountWidgetComponent extends WidgetComponent implements OnInit {
|
|||||||
valueAsNumber: number;
|
valueAsNumber: number;
|
||||||
|
|
||||||
get placeholder(): string {
|
get placeholder(): string {
|
||||||
if (!this.showPlaceholder) return '';
|
return this.showPlaceholder ? this.field.placeholder : '';
|
||||||
return this.enableDisplayBasedOnLocale
|
|
||||||
? this.currencyPipe.transform(this.field.placeholder, this.currency, this.currencyDisplay, this.decimalProperty, this.locale)
|
|
||||||
: this.field.placeholder;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
|||||||
Reference in New Issue
Block a user