Skip to content

Commit

Permalink
fix(@schematics/angular): use same property order in standalone AppCo…
Browse files Browse the repository at this point in the history
…mponent

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.
  • Loading branch information
cexbrayat authored and angular-robot[bot] committed Mar 24, 2023
1 parent 3f271a1 commit 85fe820
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { RouterOutlet } from '@angular/router';<% } %>

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

0 comments on commit 85fe820

Please sign in to comment.