Skip to content

Commit 85fe820

Browse files
cexbrayatangular-robot[bot]
authored andcommitted
fix(@schematics/angular): use same property order in standalone AppComponent
The `imports` are below the `standalone` property when generating a new component with `ng g c`. This commit moves the `imports` of the standalone `app.component.ts` file to be in a similar place.
1 parent 3f271a1 commit 85fe820

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import { RouterOutlet } from '@angular/router';<% } %>
44

55
@Component({
66
selector: '<%= selector %>',
7-
standalone: true,<% if(inlineTemplate) { %>
7+
standalone: true,
8+
imports: [CommonModule<% if(routing) { %>, RouterOutlet<% } %>],<% if(inlineTemplate) { %>
89
template: `
910
<!--The content below is only a placeholder and can be replaced.-->
1011
<div style="text-align:center" class="content">
@@ -32,8 +33,7 @@ import { RouterOutlet } from '@angular/router';<% } %>
3233
`,<% } else { %>
3334
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
3435
styles: [],<% } else { %>
35-
styleUrls: ['./app.component.<%= style %>'], <% } %>
36-
imports: [CommonModule<% if(routing) { %>, RouterOutlet<% } %>]
36+
styleUrls: ['./app.component.<%= style %>']<% } %>
3737
})
3838
export class AppComponent {
3939
title = '<%= name %>';

0 commit comments

Comments
 (0)