It look like all tutorials show how config it in the old angular.cli.json
format.
"defaults": {
"styleExt": "css",
"component": {
"inlineStyle":true,
"inlineTemplate":true
}
}
but not in the angular.json
format.
and that arises the error Workspace needs to be loaded before it is used
So how I can change the configuration of an existing project to generate component with an inline template and CSS/SCSS
Thanks.
After researching the angular CLI
command and generate a new project with that setting I come with that solution :
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"project-name": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {
"@schematics/angular:component": {
"inlineTemplate": true,
"inlineStyle": true,
"styleext": "scss"
}
}, ....
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With