File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 25
25
"@angular/animations" : " 0.0.0-NG" ,
26
26
"@angular/cdk" : " 0.0.0-PLACEHOLDER" ,
27
27
"@angular/core" : " 0.0.0-NG" ,
28
- "@angular/common" : " 0.0.0-NG"
28
+ "@angular/common" : " 0.0.0-NG" ,
29
+ "@angular/forms" : " 0.0.0-NG"
29
30
},
30
31
"dependencies" : {
31
32
"tslib" : " ^1.7.1"
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ describe('ng-add schematic', () => {
48
48
expect ( dependencies [ '@angular/material' ] ) . toBeDefined ( ) ;
49
49
expect ( dependencies [ '@angular/cdk' ] ) . toBeDefined ( ) ;
50
50
expect ( dependencies [ 'hammerjs' ] ) . toBeDefined ( ) ;
51
+ expect ( dependencies [ '@angular/forms' ] ) . toBe ( angularCoreVersion ,
52
+ 'Expected the @angular/forms package to have the same version as @angular/core.' ) ;
51
53
expect ( dependencies [ '@angular/animations' ] ) . toBe ( angularCoreVersion ,
52
54
'Expected the @angular/animations package to have the same version as @angular/core.' ) ;
53
55
Original file line number Diff line number Diff line change @@ -25,13 +25,14 @@ export default function(options: Schema): Rule {
25
25
// of the CLI project. This tag should be preferred because all Angular dependencies should
26
26
// have the same version tag if possible.
27
27
const ngCoreVersionTag = getPackageVersionFromPackageJson ( host , '@angular/core' ) ;
28
+ const angularDependencyVersion = ngCoreVersionTag || requiredAngularVersionRange ;
28
29
29
30
// In order to align the Material and CDK version with the other Angular dependencies,
30
31
// we use tilde instead of caret. This is default for Angular dependencies in new CLI projects.
31
32
addPackageToPackageJson ( host , '@angular/cdk' , `~${ materialVersion } ` ) ;
32
33
addPackageToPackageJson ( host , '@angular/material' , `~${ materialVersion } ` ) ;
33
- addPackageToPackageJson ( host , '@angular/animations' ,
34
- ngCoreVersionTag || requiredAngularVersionRange ) ;
34
+ addPackageToPackageJson ( host , '@angular/forms' , angularDependencyVersion ) ;
35
+ addPackageToPackageJson ( host , '@angular/animations' , angularDependencyVersion ) ;
35
36
36
37
if ( options . gestures ) {
37
38
addPackageToPackageJson ( host , 'hammerjs' , hammerjsVersion ) ;
You can’t perform that action at this time.
0 commit comments