Whenever we want to create a new component using Angular CLI what we usually do is by running below command:
> ng generate component <comp...
For further actions, you may consider blocking this person and/or reporting abuse
Good write-up Sumit, I was using this approach for a while but I'm lazy so I started using the shorthand version of the options, -t=true -s=true, but that's still too much typing so I updated the defaults in my angular.json file.
"schematics": {"@schematics/angular:component": {
"style": "scss",
"inlineTemplate": true,
"inlineStyle": true
}
},
Now when I run the following the component is generated in a single file with no additional components.
ng g c <component-name>In Angular V.14, you should replace
inlineTemplatewithinline-templateandinlineStylewith inline-styleto work with you and don't get this error:
Error: Unknown arguments: inlineTemplate, inlineStyle`. Thanks.