Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

fix(stepper): console error in development mode #187

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions projects/core/src/lib/stepper/stepper.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import {
QueryList,
Input,
ViewChild,
Output
Output,
ChangeDetectorRef,
AfterViewInit
} from '@angular/core';
import { FivStepContent } from './step-content/step-content.component';
import { FivStepperHorizontal } from './stepper-horizontal/stepper-horizontal.component';
Expand All @@ -18,7 +20,7 @@ import { FivStepperHorizontal } from './stepper-horizontal/stepper-horizontal.co
templateUrl: './stepper.component.html',
styleUrls: ['./stepper.component.scss']
})
export class FivStepper implements OnInit {
export class FivStepper implements OnInit, AfterViewInit {
@ContentChildren(FivStep) contents: QueryList<FivStep>;
@ViewChildren(FivStepContent) steps: QueryList<FivStepContent>;
@ViewChild(FivStepperHorizontal, { static: false })
Expand All @@ -31,10 +33,14 @@ export class FivStepper implements OnInit {

param: any;

constructor() {}
constructor(private change: ChangeDetectorRef) {}

ngOnInit() {}

ngAfterViewInit(): void {
this.change.detectChanges();
}

open(index: number) {
if (this.mode === 'horizontal') {
this.currentIndex = index;
Expand Down