Skip to content

Commit

Permalink
fix(@schematics/angular): use styleUrl
Browse files Browse the repository at this point in the history
The `ng g c` schematic is already using `styleUrl`, but `app.component.ts` was still using `styleUrls`.

(cherry picked from commit 47700e3)
  • Loading branch information
cexbrayat authored and alan-agius4 committed Nov 8, 2023
1 parent 9bf1980 commit 731917c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -11,7 +11,7 @@ import { Component } from '@angular/core';
`,<% } else { %>
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
styles: []<% } else { %>
styleUrls: ['./app.component.<%= style %>']<% } %>
styleUrl: './app.component.<%= style %>'<% } %>
})
export class AppComponent {
title = '<%= name %>';
Expand Down
Expand Up @@ -15,7 +15,7 @@ import { RouterOutlet } from '@angular/router';<% } %>
`,<% } else { %>
templateUrl: './app.component.html',<% } if(inlineStyle) { %>
styles: [],<% } else { %>
styleUrls: ['./app.component.<%= style %>']<% } %>
styleUrl: './app.component.<%= style %>'<% } %>
})
export class AppComponent {
title = '<%= name %>';
Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/build/styles/include-paths.ts
Expand Up @@ -27,8 +27,8 @@ export default async function () {

await replaceInFile(
'src/app/app.component.ts',
`'./app.component.css\'`,
`'./app.component.scss', './app.component.less'`,
`styleUrl: './app.component.css\'`,
`styleUrls: ['./app.component.scss', './app.component.less']`,
);

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

0 comments on commit 731917c

Please sign in to comment.