refactor: remove unnecessary comments and variables
Some checks failed
Some checks failed
This commit is contained in:
parent
f2d447abeb
commit
30b4cd4d8d
2 changed files with 1 additions and 6 deletions
|
@ -34,14 +34,11 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (changes['value']) {
|
if (changes['value']) {
|
||||||
if (this.countUp) {
|
if (this.countUp) {
|
||||||
const startVal = this.previousValue;
|
|
||||||
const endVal = this.value;
|
const endVal = this.value;
|
||||||
|
|
||||||
// Update the CountUp instance with new start and end values
|
|
||||||
this.countUp.update(endVal);
|
this.countUp.update(endVal);
|
||||||
this.previousValue = endVal;
|
this.previousValue = endVal;
|
||||||
} else {
|
} else {
|
||||||
// Format the initial value if CountUp is not yet initialized
|
|
||||||
this.formattedValue = new Intl.NumberFormat('de-DE', {
|
this.formattedValue = new Intl.NumberFormat('de-DE', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'EUR',
|
currency: 'EUR',
|
||||||
|
@ -58,11 +55,10 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
|
||||||
startVal: this.previousValue,
|
startVal: this.previousValue,
|
||||||
duration: this.duration,
|
duration: this.duration,
|
||||||
easingFn: (t, b, c, d) => {
|
easingFn: (t, b, c, d) => {
|
||||||
// Custom easing function based on the input ease type
|
|
||||||
if (this.ease === 'power1.out') {
|
if (this.ease === 'power1.out') {
|
||||||
return c * (1 - Math.pow(1 - t / d, 1)) + b;
|
return c * (1 - Math.pow(1 - t / d, 1)) + b;
|
||||||
}
|
}
|
||||||
return c * (t / d) + b; // linear fallback
|
return c * (t / d) + b;
|
||||||
},
|
},
|
||||||
formattingFn: (value) => {
|
formattingFn: (value) => {
|
||||||
const formatted = new Intl.NumberFormat('de-DE', {
|
const formatted = new Intl.NumberFormat('de-DE', {
|
||||||
|
|
|
@ -13,7 +13,6 @@ export class UserService {
|
||||||
public currentUser$ = this.currentUserSubject.asObservable();
|
public currentUser$ = this.currentUserSubject.asObservable();
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// Initialize with current user data
|
|
||||||
this.getCurrentUser().subscribe();
|
this.getCurrentUser().subscribe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue