From cba55bb25f6c6f3805db91380ba2fe672538ece8 Mon Sep 17 00:00:00 2001 From: Mike Brocchi Date: Mon, 13 Mar 2023 17:21:38 -0400 Subject: [PATCH] Address comments left on the PR --- .../app.component.spec.ts.template | 10 ++++------ .../standalone-files/src/app/app.config.ts.template | 2 +- .../files/standalone-files/src/index.html.template | 2 +- .../files/standalone-files/src/main.ts.template | 2 +- packages/schematics/angular/application/index.ts | 1 + 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/schematics/angular/application/files/other-standalone-files/app.component.spec.ts.template b/packages/schematics/angular/application/files/other-standalone-files/app.component.spec.ts.template index 8eda79d528db..3af88892e343 100644 --- a/packages/schematics/angular/application/files/other-standalone-files/app.component.spec.ts.template +++ b/packages/schematics/angular/application/files/other-standalone-files/app.component.spec.ts.template @@ -4,12 +4,10 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { - await TestBed.configureTestingModule({<% if (routing) { %> + await TestBed.configureTestingModule({ imports: [ - RouterTestingModule - ],<% } %> - declarations: [ - AppComponent + AppComponent<% if (routing) { %>, + RouterTestingModule<% } %> ], }).compileComponents(); }); @@ -20,7 +18,7 @@ describe('AppComponent', () => { expect(app).toBeTruthy(); }); - it(`should have as title '<%= name %>'`, () => { + it(`should have the '<%= name %>' title`, () => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.componentInstance; expect(app.title).toEqual('<%= name %>'); diff --git a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template index e4685e00725c..e25f30f3403f 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/app/app.config.ts.template @@ -1,4 +1,4 @@ -import { ApplicationConfig } from '@angular/platform-browser';<% if (routing) { %> +import { ApplicationConfig } from '@angular/core';<% if (routing) { %> import { provideRouter } from '@angular/router';<% } %> import { provideHttpClient } from '@angular/common/http';<% if (routing) { %> diff --git a/packages/schematics/angular/application/files/standalone-files/src/index.html.template b/packages/schematics/angular/application/files/standalone-files/src/index.html.template index 8a7c648e38c0..e2e52f15b22d 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/index.html.template +++ b/packages/schematics/angular/application/files/standalone-files/src/index.html.template @@ -8,6 +8,6 @@ - <<%= prefix %>-root>-root> + <<%= selector %>>> diff --git a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template index 514c89a08e23..b877166be045 100644 --- a/packages/schematics/angular/application/files/standalone-files/src/main.ts.template +++ b/packages/schematics/angular/application/files/standalone-files/src/main.ts.template @@ -3,5 +3,5 @@ import { appConfig } from './app/app.config'; import { AppComponent } from './app/app.component'; bootstrapApplication(AppComponent, appConfig).catch((err) => - console.error(err) + console.error(err); ); diff --git a/packages/schematics/angular/application/index.ts b/packages/schematics/angular/application/index.ts index 1a04c2f1d1f4..2f36c868e8fb 100644 --- a/packages/schematics/angular/application/index.ts +++ b/packages/schematics/angular/application/index.ts @@ -140,6 +140,7 @@ function getStandaloneAppRules( applyTemplates({ utils: strings, ...options, + selector: appRootSelector, relativePathToWorkspaceRoot: relativePathToWorkspaceRoot(appDir), appName: options.name, folderName,