-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[API change] Make NavigationMode classes stateless #203
Conversation
It allows the library user to easily create an instance of a particular [[NavigationMode]] class and pass it to `<aw-wizard [navigationMode]="...">`.
I'm not sure how helpful this change is to the users. I think that a significant number of users require direct access to the The problem with this PR is that it would require the users to pass the |
What if angular-archwizard provided thin wrappers for these methods in the
Benefits:
What do you think about this approach? |
I have added "[API change]" to the title to emphasize that this PR introduce incompatible changes in user-visible API. |
I agree, adding a wrapper for the methods located in the applied |
@madoar , maybe |
…nit tests. The `goToPreviousStep` and `goToNextStep` methods are no longer part of the `NavigationMode` interface.
The idea behind the |
@madoar , Is it OK that in order to query the current step the user would use Also, if we put the methods into |
I understand what you mean, yes when looking at the In this case I think we will need to go a bit further and decide which class will have which responsibilities and how we want to expose the encapsulated functionalities to the outside. I believe the easiest way to navigate the wizard from outside is via methods provided by the Summarized I'm basically fine either way. We just need to specify how the responsibilities of the classes should be split! |
I agree that responsibilities are blurred. Are you sure that we need For example, see this component: https://www.primefaces.org/primeng/#/table (scroll down to Properties section). It exposes everything right in the component class. And that component is larger that angular-archwizard. Perhaps, we should follow this example and expose all methods and properties right in the You are probably concerned by resulting code bloat. I agree, putting everything inside one class is not convenient for developers. However, I would argue that is is more convenient for users, because they have everything available right in |
No, truth be told I'm not sure whether we really need |
To me, |
@madoar , I have moved everything from |
@madoar , Thanks for review. I will get to fixing the issues in the next few days. |
… `debugElement.query`, and `Els` suffix to all arrays of native elements returned by `debugElement.queryAll`. The only exception is `xxxDiv` variables, for which the `Div` suffix is already self-explanatory.
1. Move `completed` getter closer to other properties (before constructor) 2. Do not mix Angular @input's with other properties 3. Put `currentStepIndex` and `currentStep` properties next to each other
The merge conflicts need to be solved before I can merge this PR :) |
Conflicts: src/lib/components/wizard-navigation-bar.component.spec.ts src/lib/components/wizard.component.ts src/lib/directives/wizard-step-symbol.directive.spec.ts src/lib/directives/wizard-step-title.directive.spec.ts src/lib/navigation/base-navigation-mode.interface.ts src/lib/navigation/semi-strict-navigation-mode.ts src/lib/navigation/strict-navigation-mode.ts
Now everything is fixed and ready to be merged ;-) |
It allows the library user to easily create an instance of a particular [[NavigationMode]] class and pass it to
<aw-wizard [navigationMode]="...">
.See madoar/angular-archwizard-demo#31 (comment)