Skip to content

Commit ea5d6a1

Browse files
authored
README Cleanup "Working with dynamically inserted and removed steps" (#290)
1 parent 7b7214a commit ea5d6a1

File tree

1 file changed

+4
-18
lines changed

1 file changed

+4
-18
lines changed

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -698,27 +698,13 @@ For additional information about how to write your own navigation bar please tak
698698
[wizard-navigation-bar.scss](src/css/wizard-navigation-bar.scss) file.
699699

700700
### Working with dynamically inserted and removed steps
701-
In some cases it may be required to remove or insert one or multiple steps after the wizard initialization,
702-
for example after a user does some interaction with the wizard, it may be required to add or remove a later step.
701+
In some cases it may be required to remove or insert one or multiple steps after the wizard initialization.
702+
For example after a user does some interaction with the wizard, it may be required to add or remove a later step.
703703
In such situations the wizard supports the removal and insertion of steps in the DOM.
704704

705-
If you require the dynamic removal or insertion of steps, please be aware that the angular component containing the wizard
706-
needs to trigger a `detectChanges()` call inside the `afterViewInit` lifecycle phase.
707-
This call can be triggered by adding the following lines to the component class:
708-
```typescript
709-
constructor(private _changeDetectionRef: ChangeDetectorRef) {}
710-
711-
ngAfterViewInit(): void {
712-
// Force another change detection in order to fix an occuring ExpressionChangedAfterItHasBeenCheckedError
713-
this._changeDetectionRef.detectChanges();
714-
}
715-
```
716-
717-
If an earlier step, compared to the current step, has been removed or inserted,
718-
the wizard will adjust the index of the current step to make the changed state valid again.
705+
If an earlier step, compared to the current step, has been removed or inserted, the wizard will adjust the current step to ensure that the changed state is valid again.
719706

720-
Please be also sure to not remove the step, the wizard is currently displaying, because otherwise the wizard will be inside an
721-
invalid state, which may lead to strange and unexpected behavior.
707+
When removing a step be sure to not remove the step the wizard is currently displaying, because otherwise the wizard will be inside an invalid state, which may lead to strange and unexpected behavior.
722708

723709
## Styles Customization
724710

0 commit comments

Comments
 (0)