Skip to content

Commit 47700e3

Browse files
cexbrayatalan-agius4
authored andcommitted
fix(@schematics/angular): use styleUrl
The `ng g c` schematic is already using `styleUrl`, but `app.component.ts` was still using `styleUrls`.
1 parent 78c5a12 commit 47700e3

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Component } from '@angular/core';
1111
`,<% } else { %>
1212
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
1313
styles: []<% } else { %>
14-
styleUrls: ['./app.component.<%= style %>']<% } %>
14+
styleUrl: './app.component.<%= style %>'<% } %>
1515
})
1616
export class AppComponent {
1717
title = '<%= name %>';

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { RouterOutlet } from '@angular/router';<% } %>
1515
`,<% } else { %>
1616
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
1717
styles: [],<% } else { %>
18-
styleUrls: ['./app.component.<%= style %>']<% } %>
18+
styleUrl: './app.component.<%= style %>'<% } %>
1919
})
2020
export class AppComponent {
2121
title = '<%= name %>';

tests/legacy-cli/e2e/tests/build/styles/include-paths.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default async function () {
2727

2828
await replaceInFile(
2929
'src/app/app.component.ts',
30-
`'./app.component.css\'`,
31-
`'./app.component.scss', './app.component.less'`,
30+
`styleUrl: './app.component.css\'`,
31+
`styleUrls: ['./app.component.scss', './app.component.less']`,
3232
);
3333

3434
await updateJsonFile('angular.json', (workspaceJson) => {

0 commit comments

Comments
 (0)