Skip to content

Commit be08eb9

Browse files
clydinjosephperrott
authored andcommitted
fix(ng-add): install added packages (#11163)
1 parent 81b6a78 commit be08eb9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/lib/schematics/shell/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {chain, noop, Rule, Tree} from '@angular-devkit/schematics';
1+
import {chain, noop, Rule, Tree, SchematicContext} from '@angular-devkit/schematics';
2+
import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks';
23
import {addModuleImportToRootModule, getStylesPath} from '../utils/ast';
34
import {InsertChange} from '../utils/devkit-utils/change';
45
import {getProjectFromWorkspace, getWorkspace} from '../utils/devkit-utils/config';
@@ -27,10 +28,11 @@ export default function(options: Schema): Rule {
2728

2829
/** Add material, cdk, annimations to package.json if not already present. */
2930
function addMaterialToPackageJson() {
30-
return (host: Tree) => {
31+
return (host: Tree, context: SchematicContext) => {
3132
addPackageToPackageJson(host, 'dependencies', '@angular/cdk', cdkVersion);
3233
addPackageToPackageJson(host, 'dependencies', '@angular/material', materialVersion);
3334
addPackageToPackageJson(host, 'dependencies', '@angular/animations', angularVersion);
35+
context.addTask(new NodePackageInstallTask());
3436
return host;
3537
};
3638
}

0 commit comments

Comments
 (0)