Skip to content

fix(ng-add): install added packages #11163

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/lib/schematics/shell/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {chain, noop, Rule, Tree} from '@angular-devkit/schematics';
import {chain, noop, Rule, Tree, SchematicContext} from '@angular-devkit/schematics';
import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks';
import {addModuleImportToRootModule, getStylesPath} from '../utils/ast';
import {InsertChange} from '../utils/devkit-utils/change';
import {getProjectFromWorkspace, getWorkspace} from '../utils/devkit-utils/config';
Expand Down Expand Up @@ -27,10 +28,11 @@ export default function(options: Schema): Rule {

/** Add material, cdk, annimations to package.json if not already present. */
function addMaterialToPackageJson() {
return (host: Tree) => {
return (host: Tree, context: SchematicContext) => {
addPackageToPackageJson(host, 'dependencies', '@angular/cdk', cdkVersion);
addPackageToPackageJson(host, 'dependencies', '@angular/material', materialVersion);
addPackageToPackageJson(host, 'dependencies', '@angular/animations', angularVersion);
context.addTask(new NodePackageInstallTask());
return host;
};
}
Expand Down