Skip to content

Commit f44675d

Browse files
committed
chore: documentation
1 parent 1312531 commit f44675d

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Add the ngxVibration directive to an HTML element. The directive takes a vibrati
2727
```html
2828
<button [ngxVibration]="[200, 100, 200]">VIBRATE</button>
2929
```
30+
```html
31+
<button [ngxVibration]="500">VIBRATE</button>
32+
```
33+
Or with the [global config](#global-configuration) _defaultPattern_ set:
34+
```html
35+
<button ngxVibration>VIBRATE</button>
36+
```
3037

3138
### Vibration Service
3239

@@ -48,4 +55,19 @@ export class AppComponent implements OnInit {
4855
this.vibrationService.cancelVibration();
4956
}
5057
}
51-
```
58+
```
59+
60+
### Global configuration
61+
62+
You can provide a default configuration object when importing the module using the `forRoot()` method.
63+
64+
``` typescript
65+
NgxVibrationModule.forRoot({
66+
defaultPattern: [100, 0, 100]
67+
})
68+
```
69+
70+
| Property | Type | Description |
71+
| -------------- | ---------- | ------------------------------------------------------------ |
72+
| defaultPattern | `number[]` | The pattern to use by default when no other is specified on the directives |
73+

projects/ngx-vibration/README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ Add the ngxVibration directive to an HTML element. The directive takes a vibrati
2727
```html
2828
<button [ngxVibration]="[200, 100, 200]">VIBRATE</button>
2929
```
30+
```html
31+
<button [ngxVibration]="500">VIBRATE</button>
32+
```
33+
Or with the [global config](#global-configuration) _defaultPattern_ set:
34+
```html
35+
<button ngxVibration>VIBRATE</button>
36+
```
3037

3138
### Vibration Service
3239

@@ -48,4 +55,19 @@ export class AppComponent implements OnInit {
4855
this.vibrationService.cancelVibration();
4956
}
5057
}
51-
```
58+
```
59+
60+
### Global configuration
61+
62+
You can provide a default configuration object when importing the module using the `forRoot()` method.
63+
64+
``` typescript
65+
NgxVibrationModule.forRoot({
66+
defaultPattern: [100, 0, 100]
67+
})
68+
```
69+
70+
| Property | Type | Description |
71+
| -------------- | ---------- | ------------------------------------------------------------ |
72+
| defaultPattern | `number[]` | The pattern to use by default when no other is specified on the directives |
73+

0 commit comments

Comments
 (0)