New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stepper customization #522
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
questions (non-blocking): LGTM but just quick question, why are there needs for using cdr.markForCheck()
on every @Input
?
@nartc Thanks! Good question, I'm not sure (just copy/pasted one of them xD). My best guess would be that some of those properties can be updated by code (as opposed to template binding changes). See the .first() method in the |
suggestion (non-blocking): I see. It really depends on the intended usage of the StepperComponent. If the consumers query the StepperComponent by View/ContentChild then change StepperComponent's inputs from the consumers' component, then cdr.markForCheck might be needed. For this case, I'd try removing them. Since it looks like StepperComponent is being used with Input Bindings so StepperComppnent should be marked dirty properly without markForCheck unless there are things that I'm not aware of. As for first(), this.active is set from inside of the StepperComponent itself so its setter should be invoked. Not sure why markForCheck() would be needed there, might be we're updating each StepComponent as well. But yeah, try removing those to see if the behavior's broken. |
@nartc That particular method (
But yeah,, I'll try removing it and see. Thanks 🙏 |
I missed this. Yup, in this case, |
I'm not sure where this pattern came from... I would discourage using |
@Hypercubed I agree. I removed some of them that seemed unnecessary. However, in the case of the <ngx-stepper>
<ngx-step [completeIcon]="myIcon"></ngx-step>
</ngx-stepper> In which case this ngx-ui/projects/swimlane/ngx-ui/src/lib/components/stepper/step.component.ts Lines 35 to 42 in 02cb7c0
Or they can be set as part of the containing StepperComponent :
<ngx-stepper [completeIcon]="myIcon">
<ngx-step></ngx-step> <!-- inherits completeIcon property -->
</ngx-stepper> And passed down to the steps using a ngx-ui/projects/swimlane/ngx-ui/src/lib/components/stepper/stepper.component.ts Lines 105 to 120 in 02cb7c0
In the second scenario, the change to the completeIcon property in the StepComponent , even though it's marked as an Input() , wouldn't be "change detected".. (or would it? 🤔 )
|
That is correct. Angular Compiler depends on |
Summary
[large]
input to increase the default icon size.[trackBar]
input to make track bar optional.[progress]
input to show a progress indicator on the active step.[removeHighlight]
input to remove highlight color for the completed steps.[icon]
input to show an icon instead of the step number..complete()
method to complete every step (including the last one).Checklist
/projects/swimlane/ngx-ui/CHANGELOG.md
under HEAD (Unreleased)*required