updating an array after a callback, the variable value step is not really changing, just in the console. Right now I see not the problem why this is not working.
HTML
<progress-full [stepChangeCallback]="changeStepCallback">
<progress-full-step>Introduction</progress-full-step>
<progress-full-step>Settings</progress-full-step>
<progress-full-step>Customize</progress-full-step>
</progress-full>
<div *ngIf="step[0]">Test 1</div>
<div *ngIf="step[1]">Test 2</div>
<div *ngIf="step[2]">Test 3</div>
<button-group>
<button label="Next step" onclick="document.querySelector('progress-full').nextStep()">
</button>
<button theme="secondary" label="Previous step" onclick="document.querySelector('progress-full').previousStep()">
</button>
</button-group>
<pre>{{step | json}}</pre>
TS
step = new Array(7).fill(false);
constructor() {
this.step[0] = true;
}
changeStepCallback = (num: number) => {
this.resetArray();
this.step[num - 1] = true;
console.log(this.step);
}
resetArray() {
this.step.fill(false);
}
After click on the button "Next step"