@@ -33,7 +33,7 @@ Finally, if the application uses any of the custom HammerJS gestures provided by
33
33
new ` HammerModule ` , which enabled HammerJS event bindings. These bindings were previously enabled
34
34
by default in Angular versions 8 and below.
35
35
36
- If your application provides a custom [ ` HAMMER_GESTURE_CONFIG ` ] [ 1 ] and also references the
36
+ If the application provides a custom [ ` HAMMER_GESTURE_CONFIG ` ] [ 1 ] and also references the
37
37
deprecated Angular Material ` GestureConfig ` , the migration will print a warning about
38
38
ambiguous usage. The migration cannot migrate the project automatically and manual changes
39
39
are required. Read more [ in the dedicated section] ( #The-migration-reported-ambiguous-usage-What-should-I-do ) .
@@ -62,12 +62,12 @@ import 'hammerjs';
62
62
63
63
The migration cannot automatically remove HammerJS from tests. Please manually clean up
64
64
the test setup and resolve any test issues. Read more in a
65
- [ dedicated section for test migration] ( #How-to-migrate-my-tests )
65
+ [ dedicated section for test migration] ( #How-to-migrate-my-tests ) .
66
66
67
67
### How do I migrate references to the deprecated ` GestureConfig ` ?
68
68
69
69
The ` GestureConfig ` can be consumed in multiple ways. The migration covers the most common cases.
70
- The most common case is that an ` NgModule ` in your application directly provides ` GestureConfig ` :
70
+ The most common case is that an ` NgModule ` in the application directly provides ` GestureConfig ` :
71
71
72
72
``` typescript
73
73
import {GestureConfig } from ' @angular/material/core' ;
@@ -96,8 +96,8 @@ automatically, but the migration will report such patterns and ask for manual cl
96
96
<a name =" test-migration " ></a >
97
97
### How to migrate my tests?
98
98
99
- Components in your project might use Angular Material components which previously depended
100
- on HammerJS. There might be unit tests for these components which also test gesture functionality
99
+ Components in the project might use Angular Material components which previously depended
100
+ upon HammerJS. There might be unit tests for these components which also test gesture functionality
101
101
of the Angular Material components. For such unit tests, find all failing gesture tests. These
102
102
might need to be reworked to dispatch proper events to simulate gestures, or need to be deleted.
103
103
Specifically gesture tests for the ` <mat-slide-toggle> ` should be removed. This is because the
@@ -107,9 +107,9 @@ If some unit tests depend on the deprecated Angular Material `GestureConfig` to
107
107
events, the reference should be either removed and tests reworked to use DOM events, or the
108
108
reference should be changed to the new gesture config created by the migration.
109
109
110
- If HammerJS has been removed by the migration from the project, you might able to need to
111
- clean up test setup that provides HammerJS. This is usually done in the test main file (usually
112
- in ` src/test.ts ` ) where ` hammerjs ` is imported.
110
+ If HammerJS has been removed from the project by the migration, there might be a need to refactor
111
+ the test setup that provides HammerJS. This is usually done in the test main file (usually
112
+ in ` src/test.ts ` ) where ` hammerjs ` may be imported.
113
113
114
114
``` typescript
115
115
import ' hammerjs' ;
@@ -129,14 +129,16 @@ plugin, or to an actual `@Output`. For example:
129
129
130
130
In the example above, ` rotate ` could be an event from the deprecated ` GestureConfig ` , or an
131
131
` @Output ` from ` <image-rotator> ` . The migration warns about this to raise awareness that it
132
- might have _ incorrectly kept_ HammerJS. Please manually check if you can remove HammerJS.
132
+ might have _ incorrectly kept_ HammerJS. Please check if HammerJS can be removed from the project
133
+ manually.
133
134
134
135
** Case 2** : The deprecated Angular Material ` GestureConfig ` is used in combination with a
135
136
custom [ ` HAMMER_GESTURE_CONFIG ` ] [ 1 ] . This case is ambiguous because the migration is unable
136
137
to detect whether a given HammerJS event binding corresponds to the custom gesture config, or to
137
- the deprecated Angular Material gesture config. If such a warning has been reported to you, check
138
- if you can remove references to the deprecated ` GestureConfig ` , or if you need to handle the events
139
- provided by the deprecated gesture config in your existing custom gesture config.
138
+ the deprecated Angular Material gesture config. If such a warning has been reported, check
139
+ if the references to the deprecated ` GestureConfig ` can be removed, or if the existing, custom
140
+ gesture config needs to be updated to handle the events provided by the deprecated Angular Material
141
+ ` GestureConfig ` .
140
142
141
143
[ 1 ] : https://v9.angular.io/api/platform-browser/HammerGestureConfig
142
144
[ 2 ] : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Import_a_module_for_its_side_effects_only
0 commit comments