File tree Expand file tree Collapse file tree 2 files changed +46
-2
lines changed
Expand file tree Collapse file tree 2 files changed +46
-2
lines changed Original file line number Diff line number Diff 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+
Original file line number Diff line number Diff 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+
You can’t perform that action at this time.
0 commit comments