MCPcopy Create free account
hub / github.com/angular/components / LinearMatVerticalStepperApp

Class LinearMatVerticalStepperApp

src/material/stepper/stepper.spec.ts:1973–2025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1971}
1972
1973@Component({
1974 template: `
1975 <mat-stepper orientation="vertical" linear>
1976 <mat-step [stepControl]="oneGroup">
1977 <form [formGroup]="oneGroup">
1978 <ng-template matStepLabel>Step one</ng-template>
1979 <input formControlName="oneCtrl" required>
1980 <div>
1981 <button matStepperPrevious>Back</button>
1982 <button matStepperNext>Next</button>
1983 </div>
1984 </form>
1985 </mat-step>
1986 <mat-step [stepControl]="twoGroup">
1987 <form [formGroup]="twoGroup">
1988 <ng-template matStepLabel>Step two</ng-template>
1989 <input formControlName="twoCtrl" required>
1990 <div>
1991 <button matStepperPrevious>Back</button>
1992 <button matStepperNext>Next</button>
1993 </div>
1994 </form>
1995 </mat-step>
1996 <mat-step [stepControl]="threeGroup" optional>
1997 <form [formGroup]="threeGroup">
1998 <ng-template matStepLabel>Step two</ng-template>
1999 <input formControlName="threeCtrl">
2000 <div>
2001 <button matStepperPrevious>Back</button>
2002 <button matStepperNext>Next</button>
2003 </div>
2004 </form>
2005 </mat-step>
2006 <mat-step>
2007 Done
2008 </mat-step>
2009 </mat-stepper>
2010 `,
2011 imports: [ReactiveFormsModule, MatStepperModule],
2012 changeDetection: ChangeDetectionStrategy.Eager,
2013})
2014class LinearMatVerticalStepperApp {
2015 validationTrigger = new Subject<void>();
2016 oneGroup = new FormGroup({
2017 oneCtrl: new FormControl('', Validators.required),
2018 });
2019 twoGroup = new FormGroup({
2020 twoCtrl: new FormControl('', Validators.required, asyncValidator(3, this.validationTrigger)),
2021 });
2022 threeGroup = new FormGroup({
2023 threeCtrl: new FormControl('', Validators.pattern(VALID_REGEX)),
2024 });
2025}
2026
2027@Component({
2028 template: `

Callers

nothing calls this directly

Calls 1

asyncValidatorFunction · 0.85

Tested by

no test coverage detected