Skip to content
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

Documentation doesn't mention need to manually change schematics to properly generate angular components #1579

Open
gbrunow opened this issue Mar 12, 2019 · 2 comments

Comments

@gbrunow
Copy link

@gbrunow gbrunow commented Mar 12, 2019

Make sure to check the existing issues in this repository

Please, tell us what's the problem?

[ ] A typo
[ ] Wrong documentation
[x] Improvement of existing article
[ ] Missing documentation
[x] New article needed

Please, tell us more details

  • After enabling sass the schematics for new angular components are not automatically set causing ng g c some-component to generate *.css files instead of *.scss files.
  • In order to have the new components properly generated you need to change the schematics for new nativescript components on angular.json like so:
"schematics": {
  "@nativescript/schematics:component": {
    "styleext": "scss"
  }
}
  • This seems to not be mentioned in the documentation
  • Moreover I couldn't find a way of setting this through the CLI.
@armpogart
Copy link

@armpogart armpogart commented Apr 13, 2019

You can run (it is documented in Angular CLI docs):

ng config schematics.@schematics/angular:component.styleext scss

the changes are reflected in angular.json file, but unfortunately it doesn't take effect and generating new component still creates css files instead of scss.

@armpogart
Copy link

@armpogart armpogart commented Apr 13, 2019

I have just noticed that you mentioned in your issue how to set default styles extensions for @nativescript/schematics and it turns out that ng g c some-component uses that schematic instead of angular one. I would propose to document also setting it through command line by running:

ng config schematics.@nativescript/schematics:component.styleext scss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.