Support Angular inline styles as single template literal (#15968)

This commit is contained in:
SUZUKI Sosuke authored and GitHub committed 2024-01-21 18:10:21 +09:00
1 parent 4b1965ae45
commit 2fe7f4193a
5 files changed
+231 -9

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
#### Support Angular inline styles as single template literal (#15968 by @sosukesuzuki)
[Angular v17](https://blog.angular.io/introducing-angular-v17-4d7033312e4b) supports single string inline styles.
<!-- prettier-ignore -->
```ts
// Input
@Component({
template: `<div>...</div>`,
styles: `h1 { color: blue; }`,
})
export class AppComponent {}
// Prettier stable
@Component({
template: `<div>...</div>`,
styles: `h1 { color: blue; }`,
})
export class AppComponent {}
// Prettier main
@Component({
template: `<div>...</div>`,
styles: `
h1 {
color: blue;
}
`,
})
export class AppComponent {}
```