Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng generate component only creating .ts file

I'm new to angular and recently bought a theme called Metronic. I installed all the required stuff including the latest angular CLI version. When I run the command ng generate component test, it will create a test folder but only a test.ts file with no html and css.

In all the examples that I've seen, this command will always create html, css, ts... so I am confused why it would only create the ts file for me?

Any help appreciated, Thank you

like image 752
Pierre-Olivier Morin Avatar asked Jan 23 '18 15:01

Pierre-Olivier Morin


1 Answers

In angular6 Inside the angular.json file you need to change "@schematics/angular:component {}"

make: "inlineStyle": false, "inlineTemplate": false,

should look like this:

"@schematics/angular:component": {
      "spec": false,
      "inlineStyle": false,
      "inlineTemplate": false,
      "prefix": "app",
      "styleext": "css"
    },

this will create your all three files (html,ts and css)

like image 95
Shailesh kala Avatar answered Oct 18 '22 04:10

Shailesh kala