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
feat(core): support styles and styleUrl as strings #51715
Conversation
Hello @crisbeto This example below looks like it accepts multiple urls because of the naming. Imo, The correct way it should look like is: But that would require big changes I believe. |
Yeah, I agree that the naming is problematic, but I think that splitting it on the comma would be weird as well. Introducing a |
My two cents here: the Angular API already has at least one other place where it uses the plural form to also accept a single thing: https://angular.io/api/forms/AbstractControlOptions. So keeping |
345c50e
to
4a55966
Compare
Based on what we discussed with @jelbourn: I've introduced a new |
4a55966
to
3b94c22
Compare
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.
LGTM
Reviewed-for: public-api
Reviewed-for: fw-core
Adds support for passing in `@Component.styles` as a string. Also introduces a new `styleUrl` property on `@Component` for providing a single stylesheet. This is more convenient for the most common case where a component only has one stylesheet associated with it.
3b94c22
to
1d26f71
Compare
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.
reviewed-for: fw-core, fw-testing, public-api
This PR was merged into the repository by commit 59387ee. |
Thank you guys, I know this is a silly small thing but it's really something I bet all developers have come across: it really makes the developing experience better, because 99% of all cases there'll only be 1 styles file. Thanks!!! |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds support for passing in `@Component.styles` as a string. Also introduces a new `styleUrl` property on `@Component` for providing a single stylesheet. This is more convenient for the most common case where a component only has one stylesheet associated with it. PR Close angular#51715
Adds support for passing in
@Component.styles
as a string. Also introduces a newstyleUrl
property on@Component
for providing a single stylesheet. This is more convenient for the most common case where a component only has one stylesheet associated with it.