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
Copy file name to clipboardExpand all lines: README.md
+48-65Lines changed: 48 additions & 65 deletions
Original file line number
Diff line number
Diff line change
@@ -4,31 +4,26 @@
4
4
5
5
**[angular-shepherd is built and maintained by Ship Shape. Contact us for web app consulting, development, and training for your project](https://shipshape.io/)**.
[](http://badge.fury.io/js/angular-shepherd)[]()
11
8
12
-
This is an Angular wrapper for the [Shepherd](https://github.com/shipshapecode/shepherd), site tour, library.
13
-
It provides additional functionality, on top of Shepherd, as well.
9
+
This is an Angular wrapper for the [Shepherd](https://github.com/shipshapecode/shepherd), site tour, library. It provides additional functionality, on top of Shepherd, as well.
14
10
15
11
## Compatibility
16
12
17
-
* Angular 8: 0.5.0
18
-
* Angular 9: 0.6.0
19
-
* Angular 10: 0.7.0
20
-
* Angular 11: 11.x
21
-
* Angular 12: 12.x
22
-
* Angular 13: 13.x
23
-
* Angular 14: 14.x
24
-
* Angular 15: 15.x
25
-
* Angular 16: 16.x
26
-
* Angular 17: 17.x
27
-
* Angular 18: 18.x
28
-
* Angular 19: 19.x
29
-
30
-
This has not been tested in anything but Angular 8+. It may or may not work in previous versions or subsequent versions
31
-
of Angular. We would love to support multiple versions, if people with more Angular knowledge would be willing to help us out!
13
+
- Angular 8: 0.5.0
14
+
- Angular 9: 0.6.0
15
+
- Angular 10: 0.7.0
16
+
- Angular 11: 11.x
17
+
- Angular 12: 12.x
18
+
- Angular 13: 13.x
19
+
- Angular 14: 14.x
20
+
- Angular 15: 15.x
21
+
- Angular 16: 16.x
22
+
- Angular 17: 17.x
23
+
- Angular 18: 18.x
24
+
- Angular 19: 19.x
25
+
26
+
This has not been tested in anything but Angular 8+. It may or may not work in previous versions or subsequent versions of Angular. We would love to support multiple versions, if people with more Angular knowledge would be willing to help us out!
**NOTE: This may not be the proper Angular way to do everything, as I am not
42
-
an Angular dev, so please let me know if you have suggestions!**
36
+
**NOTE: This may not be the proper Angular way to do everything, as I am not an Angular dev, so please let me know if you have suggestions!**
43
37
44
-
Shepherd ships a single style file, which you will need to include. You can do so by adding it
45
-
to your angular.json.
38
+
Shepherd ships a single style file, which you will need to include. You can do so by adding it to your angular.json.
46
39
47
40
```json
48
41
"styles": [
49
42
"node_modules/shepherd.js/dist/css/shepherd.css"
50
43
],
51
44
```
52
45
53
-
Then, you will need to inject the `ShepherdService` to be able to interact with Shepherd and
54
-
call `addSteps` to add your steps, `start` to start the tour, etc.
46
+
Then, you will need to inject the `ShepherdService` to be able to interact with Shepherd and call `addSteps` to add your steps, `start` to start the tour, etc.
55
47
56
-
You could either do this at the application level, in your application component
57
-
or on a per component or per route/view basis.
48
+
You could either do this at the application level, in your application component or on a per component or per route/view basis.
58
49
59
-
**NOTE: It is highly recommended to inject ShepherdService into your `app.component.ts`. Injecting it
60
-
at the app level ensures you only create one instance of Shepherd.**
50
+
**NOTE: It is highly recommended to inject ShepherdService into your `app.component.ts`. Injecting it at the app level ensures you only create one instance of Shepherd.**
61
51
62
52
In that component you will want to use `AfterViewInit` to `addSteps` to the Shepherd service.
@@ -87,25 +76,21 @@ export class ShepherdComponent implements AfterViewInit {
87
76
88
77
## Configuration
89
78
90
-
The following configuration options can be set on the ShepherdService to control the way that Shepherd is used.
91
-
**The only required option is `steps`, which is set via `addSteps`.**
79
+
The following configuration options can be set on the ShepherdService to control the way that Shepherd is used. **The only required option is `steps`, which is set via `addSteps`.**
92
80
93
81
### confirmCancel
94
82
95
-
`confirmCancel` is a boolean flag, when set to `true` it will pop up a native browser
96
-
confirm window on cancel, to ensure you want to cancel.
83
+
`confirmCancel` is a boolean flag, when set to `true` it will pop up a native browser confirm window on cancel, to ensure you want to cancel.
97
84
98
85
### confirmCancelMessage
99
86
100
-
`confirmCancelMessage` is a string to display in the confirm dialog when `confirmCancel`
101
-
is set to true.
87
+
`confirmCancelMessage` is a string to display in the confirm dialog when `confirmCancel` is set to true.
102
88
103
89
### defaultStepOptions
104
90
105
-
`defaultStepOptions` is used to set the options that will be applied to each step by default.
106
-
You can pass in any of the options that you can with Shepherd.
91
+
`defaultStepOptions` is used to set the options that will be applied to each step by default. You can pass in any of the options that you can with Shepherd.
107
92
108
-
**⚠️ You must set `defaultStepOptions`*BEFORE* calling `addSteps` to set the steps.**
93
+
**⚠️ You must set `defaultStepOptions`_BEFORE_ calling `addSteps` to set the steps.**
`requiredElements` is an array of objects that indicate DOM elements that are **REQUIRED** by your tour and must
128
-
exist and be visible for the tour to start. If any elements are not present, it will keep the tour from starting.
111
+
`requiredElements` is an array of objects that indicate DOM elements that are **REQUIRED** by your tour and must exist and be visible for the tour to start. If any elements are not present, it will keep the tour from starting.
129
112
130
113
You can also specify a message, which will tell the user what they need to do to make the tour work.
131
114
132
-
**⚠️ You must set `requiredElements`*BEFORE* calling `addSteps` to set the steps.**
115
+
**⚠️ You must set `requiredElements`_BEFORE_ calling `addSteps` to set the steps.**
message:'User not logged in, please log in to start this tour.',
145
129
title:'Please login'
146
-
},
130
+
}
147
131
];
148
132
```
149
133
150
134
> **default value:**`[]`
151
135
152
136
### modal
153
137
154
-
`modal` is a boolean, that should be set to true, if you would like the rest of the screen, other than the current element,
155
-
greyed out, and the current element highlighted. If you do not need modal functionality, you can remove this option or set it to false.
138
+
`modal` is a boolean, that should be set to true, if you would like the rest of the screen, other than the current element, greyed out, and the current element highlighted. If you do not need modal functionality, you can remove this option or set it to false.
156
139
157
140
> **default value:**`false`
158
141
@@ -164,8 +147,8 @@ You must pass an array of steps to `addSteps`, something like this:
In Shepherd, you can have as many buttons as you want inside a step. You can build an object with some premade buttons, making it easier to manipulate and insert in new steps. Buttons by default accept three different types: back, cancel, next. In this simple example, we have three buttons: each one with different types and classes.
202
+
In Shepherd, you can have as many buttons as you want inside a step. You can build an object with some premade buttons, making it easier to manipulate and insert in new steps. Buttons by default accept three different types: back, cancel, next. In this simple example, we have three buttons: each one with different types and classes.
220
203
221
204
```js
222
205
constbuiltInButtons= {
223
206
cancel: {
224
-
classes:"cancel-button",
225
-
text:"Cancel",
226
-
type:"cancel"
207
+
classes:'cancel-button',
208
+
text:'Cancel',
209
+
type:'cancel'
227
210
},
228
211
next: {
229
-
classes:"next-button",
230
-
text:"Next",
231
-
type:"next"
212
+
classes:'next-button',
213
+
text:'Next',
214
+
type:'next'
232
215
},
233
216
back: {
234
-
classes:"back-button",
217
+
classes:'back-button',
235
218
secondary:true,
236
-
text:"Back",
237
-
type:"back"
219
+
text:'Back',
220
+
type:'back'
238
221
}
239
222
};
240
223
```
@@ -244,9 +227,9 @@ Buttons have an action property, which must be a function. Whenever the button i
0 commit comments