Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const modulePath = `apps/${options.name}/src/app/app.module.ts`;
const moduleFile = ts.createSourceFile(
modulePath,
host.read(modulePath).toString(),
ts.ScriptTarget.Latest,
true
);
insert(host, modulePath, [
insertImport(
moduleFile,
modulePath,
'HttpClientModule',
`@angular/common/http`
),
...addImportToModule(
moduleFile,
`@angular/common/http`,
`HttpClientModule`
)
]);
const scope = options.npmScope;
const style = options.style ? options.style : 'css';
host.overwrite(
`apps/${options.name}/src/app/app.component.ts`,
`import { Component } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Message } from '@${scope}/api-interfaces';
@Component({
selector: '${scope}-root',