You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aad353e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+25-12Lines changed: 25 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
[](https://travis-ci.org/angular-wizard/angular-wizard)[](https://www.codacy.com/app/jc_2/angular-wizard?utm_source=github.com&utm_medium=referral&utm_content=angular-wizard/angular-wizard&utm_campaign=Badge_Grade)[](https://coveralls.io/github/angular-wizard/angular-wizard?branch=master)[](https://badge.fury.io/js/angular-wizard)[](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=martin%40gon%2eto&lc=US&item_name=Martin%20Gontovnikas¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"Donate once-off to this project using PayPal")
4
4
[](https://gratipay.com/mgonto/)
5
5
6
-
Angular-wizard is a component that will make it easy for you to create wizards in your app. You can check a running example of the wizard [by clicking here](http://mgonto.github.io/angular-wizard/)
6
+
Angular-wizard is a component that will make it easy for you to create wizards in your app. You can check a running example of the wizard [by clicking here](http://angular-wizard.github.io/angular-wizard/)
7
7
8
8
# How do I add this to my project?
9
9
You can download this by:
@@ -15,12 +15,12 @@ You can download this by:
15
15
16
16
````html
17
17
<!-- Use LATEST folder to always get the latest version-->
<p>Here you can use whatever you want. You can use other directives, binding, etc.</p>
@@ -73,6 +73,7 @@ Let's go step by step to see how this works.
73
73
74
74
1) You need to declare a master `wizard` directive. This wizard directive, has the following options as attributes:
75
75
***on-finish**: Here you can put a function to be called when the wizard is finished. The syntax here is very similar to `ng-click`
76
+
***on-cancel**: Here you can put a function to be called when the wizard is cancelled. The syntax here is very similar to `ng-click`
76
77
***name**: The name of the wizard. By default, it's called "Default wizard". It's used for the `WizardHandler` which we'll explain later.
77
78
***edit-mode**: If set to true, this will set the wizard as edit mode. Edit mode means that all steps have been completed and the user can now navigate to and modify any step. Defaults to false.
78
79
***hide-indicators**: If set to true, the indicators in the bottom of the page showing the current page and allowing navigation for the wizard will be hidden. Defaults to false.
@@ -82,6 +83,7 @@ Let's go step by step to see how this works.
82
83
83
84
2) Inside the wizard, we can have as many steps as we want. Each step MUST have a title which is going to be used to identify it. Inside each step, we can put whatever we want. Other directives, bindings, controls, forms, etc. Each step can have the following attributes (we will go into detail on each further below):
84
85
***wz-title:** A unique title used for identifying each step.
86
+
***wz-heading-title** A heading title display above step indicators
85
87
***canenter**
86
88
***canexit**
87
89
***wz-disabled**
@@ -91,7 +93,7 @@ Let's go step by step to see how this works.
91
93
92
94
3) Inside the step, we now see a button which has a `wz-next` attribute. That means that clicking that button will send the user to the next step of wizard. Similar to `wz-next`, we have the following attributes:
93
95
***wz-previous**: Goes to the previous step
94
-
***wz-cancel**: Goes back to the first step
96
+
***wz-cancel**: Calls on-cancel if defined, otherwise the default action is to go back to the first step
95
97
***wz-finish**: Finishes the wizard and calls the on-finish later on. It's important to note that if we're in the last step and we put `wz-next` it'll be the same as putting `wz-finish` as the wizard will know we're at the last screen.
96
98
***wz-reset**: This will reset the wizard meaning bring the user to the first step and reset each step to being incomplete.
97
99
@@ -110,7 +112,7 @@ A step can be conditionally disabled and may change at any time either adding it
<p>Here you can use whatever you want. You can use other directives, binding, etc.</p>
@@ -219,6 +221,17 @@ The functions available in the `wizard()` are:
219
221
***currentStep()**: This returns an Object which is the current step you are on.
220
222
***totalStepCount()**: This returns an Number which is the total number of **enabled** steps.
221
223
***getEnabledSteps()**: This returns an Array which is the **enabled** steps.
224
+
***setEditMode(boolean)**: Set the edit mode of the wizard. Setting editMode to `true` will make ALL steps accessible, setting edit mode to `false` will make all steps with an index lower than the latest "completed" step accessible.
225
+
226
+
## Events
227
+
Angular Wizard emits the following events on the `scope` and pass an object with the step info and the index as argument:
228
+
-`wizard:stepChanged`: When succeed changing the current step
229
+
-`wizard:stepChangeFailed`: When changing step and either fails `canexit` of leaving step or `canenter` of arriving step.
0 commit comments