feat: implement loading state for checkout process and enhance stepper component
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import { ChangeDetectionStrategy, Component, contentChildren, signal } from '@angular/core';
|
||||
import {
|
||||
ChangeDetectionStrategy,
|
||||
Component,
|
||||
contentChildren,
|
||||
input,
|
||||
linkedSignal,
|
||||
} from '@angular/core';
|
||||
import { StepComponent } from './step.component';
|
||||
import { NgClass } from '@angular/common';
|
||||
|
||||
@@ -11,7 +17,8 @@ import { NgClass } from '@angular/common';
|
||||
})
|
||||
export class StepperComponent {
|
||||
readonly steps = contentChildren(StepComponent);
|
||||
readonly currentStepIndex = signal(0);
|
||||
readonly initialStepIndex = input(0);
|
||||
readonly currentStepIndex = linkedSignal(() => this.initialStepIndex());
|
||||
|
||||
next() {
|
||||
const currentSteps = this.steps();
|
||||
|
||||
Reference in New Issue
Block a user