-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
angular.js templates problem-custom components are converted to self-closing tags #5436
Comments
From #1882 (comment):
|
BTW I don't mind if prettier says-hey let's not support that archaic framework. I can't wait until we can refactor it all to react in our app. |
This isn't a framework issue. Custom elements cannot be self-closing, otherwise known as void elements in the spec: https://html.spec.whatwg.org/multipage/syntax.html#void-elements. |
It seems you're using Prettier 1.15.2 --parser babylon Input: <analytics-top-resources
ng-if="analytics.isTabSelected( 'resources' )"
></analytics-top-resources> Output: <analytics-top-resources ng-if="analytics.isTabSelected( 'resources' )" />; Though we did not support angular.js (e.g., format Prettier 1.15.2 --parser html Input: <analytics-top-resources
ng-if="analytics.isTabSelected( 'resources' )"
></analytics-top-resources> Output: <analytics-top-resources
ng-if="analytics.isTabSelected( 'resources' )"
></analytics-top-resources> (Please provide text example next time.) |
@ikatyang oh my I am so sorry! I ran the command using my global installation of prettier and didn't notice it until today. 1.15.x works beautifully and it even uncovered cases where we currently have templates with a bad syntax: Accept my humble apologies. I am gonna go and uninstall it now. Global installs are a pain. Maybe come tho think of it-wouldn't it be nice to show a warning(with a current version printed out) when running prettier from a global install instead of a local one? |
So I guess my question is-is this intentional? Prettier doesn't support angular.js?
Because only way to write a custom component in an Angular.js template is to use both opening and closing tag.
The text was updated successfully, but these errors were encountered: