Skip to content

Commit 18231e0

Browse files
JeanMecheclydin
authored andcommitted
refactor(@angular-devkit/schematics): remove CommonModule
The template now uses the new control flow syntax
1 parent 43b09ce commit 18231e0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

packages/schematics/angular/application/files/standalone-files/src/app/app.component.ts.template

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
import { Component } from '@angular/core';
2-
import { CommonModule } from '@angular/common';<% if(routing) { %>
1+
import { Component } from '@angular/core';<% if(routing) { %>
32
import { RouterOutlet } from '@angular/router';<% } %>
43

54
@Component({
65
selector: '<%= selector %>',
76
standalone: true,
8-
imports: [CommonModule<% if(routing) { %>, RouterOutlet<% } %>],<% if(inlineTemplate) { %>
7+
imports: [<% if(routing) { %>RouterOutlet<% } %>],<% if(inlineTemplate) { %>
98
template: `
109
<h1>Welcome to {{title}}!</h1>
1110

1211
<% if (routing) {
13-
%><router-outlet></router-outlet><%
12+
%><router-outlet /><%
1413
} %>
1514
`,<% } else { %>
1615
templateUrl: './app.component.html',<% } if(inlineStyle) { %>

packages/schematics/angular/application/index_spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ describe('Application Schematic', () => {
538538

539539
const component = tree.readContent('/projects/foo/src/app/app.component.ts');
540540
expect(component).toContain(`import { RouterOutlet } from '@angular/router';`);
541-
expect(component).toContain(`imports: [CommonModule, RouterOutlet]`);
541+
expect(component).toContain(`imports: [RouterOutlet]`);
542542

543543
const config = tree.readContent('/projects/foo/src/app/app.config.ts');
544544
expect(config).toContain(`import { provideRouter } from '@angular/router';`);

0 commit comments

Comments
 (0)