diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template index 71e7e0bffc24..0e6ebd5930a7 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app__suffix__.ts.template @@ -11,9 +11,9 @@ import { RouterOutlet } from '@angular/router';<% } %> %><% } %> `,<% } else { %> - templateUrl: './app.html',<% } if(inlineStyle) { %> + templateUrl: './app<%= suffix %>.html',<% } if(inlineStyle) { %> styles: [],<% } else { %> - styleUrl: './app.<%= style %>'<% } %> + styleUrl: './app<%= suffix %>.<%= style %>'<% } %> }) export class App { protected readonly title = signal('<%= name %>'); diff --git a/packages/schematics/angular/application/index_spec.ts b/packages/schematics/angular/application/index_spec.ts index 863d0d021cb6..e1867b24cf41 100644 --- a/packages/schematics/angular/application/index_spec.ts +++ b/packages/schematics/angular/application/index_spec.ts @@ -869,4 +869,14 @@ describe('Application Schematic', () => { const stylesContent = tree.readContent('/projects/foo/src/styles.css'); expect(stylesContent).toContain('@import "tailwindcss";'); }); + + describe(`fileNameStyleGuide: '2016'`, () => { + it('should create a component with the correct template and style urls', async () => { + const options = { ...defaultOptions, fileNameStyleGuide: '2016' as const }; + const tree = await schematicRunner.runSchematic('application', options, workspaceTree); + const component = tree.readContent('/projects/foo/src/app/app.component.ts'); + expect(component).toContain(`templateUrl: './app.component.html'`); + expect(component).toContain(`styleUrl: './app.component.css'`); + }); + }); });