question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Material schematics doesn't work with configured angular schematics (scss, spec, etc...)

See original GitHub issue

Bug, feature request, or proposal:

BUG

What is the expected behavior?

When I’ve configured the CLI to use scss and skip tests for generated components, I would expect the material schematics to use already defined configuration when generating components (such as the dashboard).

What is the current behavior?

When I try to create material-dashboard it is created with .css instead of .scss and with .spec file

What are the steps to reproduce?

ng new <project-name> --style=scss --skip-tests
ng add @angular/material@6.2.1 <-- I use 6.2.1 because https://github.com/angular/material2/issues/11836
ng generate @angular/material:material-dashboard --name dashboard

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

"@angular/animations": "^6.0.0",
"@angular/cdk": "^6.2.0",
"@angular/common": "^6.0.0",
"@angular/compiler": "^6.0.0",
"@angular/core": "^6.0.0",
"@angular/forms": "^6.0.0",
"@angular/http": "^6.0.0",
"@angular/material": "^6.2.1",
"@angular/platform-browser": "^6.0.0",
"@angular/platform-browser-dynamic": "^6.0.0",
"@angular/router": "^6.0.0",

"@angular/cli": "~6.0.1",

Is there anything else we should know?

I see that command “ng add @angular/material” add only theme file in angular.json

"styles": [
    {
        "input": "node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
    },
    "src/styles.scss"
],

May be that command has to add schematic too?

"schematics": {
    "@schematics/material:material-dashboard": {
        "styleext": "scss",
        "spec": false
    },
    ....
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
gbragacommented, Sep 7, 2018

What is the current state? I’m also having the same problem. I only executed two commands:

ng new _my-project_
ng add @ angular / material

And I got this error. What is the official solution?

1reaction
devversioncommented, Aug 29, 2018

Since 5144aa7, we already respect the stylext default option. I will be working on respecting the following supported default options:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extend Angular Schematics to customize your development ...
We are running a schematic!​​ We need to link our schematics directory to the Angular project and set it as the default schematics...
Read more >
Schematics - Angular Material
The table schematic will create a component that renders an Angular Material <table> which has been pre-configured with a datasource for sorting and...
Read more >
Schematics: Add Tailwind CSS to your Angular project
We'll need to do a couple of things to get this working. create webpack config files for dev and production builds. create a...
Read more >
Error configuring Universal Angular
I would greatly appreciate your help, the problem is that I have my app with wordpress rest api, but I can not apply...
Read more >
Angular CLI SASS options - Stack Overflow
Updating existing project · Use SCSS syntax ng config schematics.@schematics/angular:component.styleext scss · Use SASS syntax ng config schematics.@schematics/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found