Anjali Raj
Anjali Raj

Reputation: 17

How to initialise a stepper in Angular?

I have written this code in my typescript file.

  @ViewChild('stepper') stepper: MatStepper;

And it also has this,

/** Dialog for uploading avails. */
@Component({
  selector: 'upload-avails-dialog',
  templateUrl: './upload_avails_dialog.ng.html',
  styleUrls: ['./upload_avails_dialog.scss'],
  providers: [
    {provide: STEPPER_GLOBAL_OPTIONS, useValue: {showError: true}},
    {provide: ALKALI_UPLOAD_HANDLER, useExisting: UploadsApiClient}
  ],
})

I want to use this stepper variable like:

this.stepper.next()

when I complete the execution of a function.

Property 'stepper' has no initializer and is not definitely assigned in the constructor.ts.sema(2564)

I do have a constructor,

constructor(
      private readonly snackBar: MatSnackBar,
      private readonly argonCreateInputAvailSetService:
          CreateInputAvailSetApiClient,
      private readonly argonGetInputAvailSetService: V1ApiClient) {
    this.uploadDetails = {
      '@type': UPLOAD_REQUEST_PROTO_NAME,
      'uploadType':
          UploadFileMetadataUploadTypeEnum.AVAILS_IMPORT_UPLOAD_TYPE_1_7,
    };
    this.checkUploadedXLSXLoading = false;
    this.validationStage = this.processingStage.NOT_READY;
    this.submitStage = this.processingStage.NOT_READY;
    this.fileName = '';
  }

But, I don't kow how to initialise this variable stepper?

Upvotes: 0

Views: 575

Answers (0)

Related Questions