Skip to content

Commit 3031631

Browse files
chrisguttandinKeen Yee Liau
authored and
Keen Yee Liau
committed
fix(@schematics/angular): set inlineTemplate and inlineStyle for minimal projects
1 parent 352c574 commit 3031631

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

packages/schematics/angular/application/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,15 @@ function addAppToWorkspaceFile(options: ApplicationOptions, appDir: string): Rul
151151

152152
const schematics: JsonObject = {};
153153

154-
if (options.inlineTemplate === true
155-
|| options.inlineStyle === true
154+
if (options.inlineTemplate
155+
|| options.inlineStyle
156+
|| options.minimal
156157
|| options.style !== Style.Css) {
157158
const componentSchematicsOptions: JsonObject = {};
158-
if (options.inlineTemplate === true) {
159+
if (options.inlineTemplate || options.minimal) {
159160
componentSchematicsOptions.inlineTemplate = true;
160161
}
161-
if (options.inlineStyle === true) {
162+
if (options.inlineStyle || options.minimal) {
162163
componentSchematicsOptions.inlineStyle = true;
163164
}
164165
if (options.style && options.style !== Style.Css) {

packages/schematics/angular/application/index_spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,19 @@ describe('Application Schematic', () => {
184184
expect(architect.e2e).not.toBeDefined();
185185
});
186186

187+
it('minimal=true should configure the schematics options for components', async () => {
188+
const options = { ...defaultOptions, minimal: true };
189+
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)
190+
.toPromise();
191+
const config = JSON.parse(tree.readContent('/angular.json'));
192+
const schematics = config.projects.foo.schematics;
193+
expect(schematics['@schematics/angular:component']).toEqual({
194+
inlineTemplate: true,
195+
inlineStyle: true,
196+
skipTests: true,
197+
});
198+
});
199+
187200
it('should create correct files when using minimal', async () => {
188201
const options = { ...defaultOptions, minimal: true };
189202
const tree = await schematicRunner.runSchematicAsync('application', options, workspaceTree)

0 commit comments

Comments
 (0)