New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Angular inline styles as single template literal #15968
Conversation
const isStyleProperty = (node, name) => | ||
isObjectProperty(node) && | ||
node.key.type === "Identifier" && | ||
node.key.name === "styles" && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!node.computed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed this and added tests. Also I've create the new similar issue for template
as a good first ( #15969 )
src/language-js/embed/utils.js
Outdated
name === "value", | ||
...angularComponentObjectExpressionPredicates, | ||
const isTemplateLiteral = (node) => node.type === "TemplateLiteral"; | ||
const isStyleProperty = (node, name) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about isObjectPropertyNamedStyles
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second parameter should be named key
Description
Closes #15934
Checklist
changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨