node.js - Creating component using Angular cli in VS 2017 Angular Template -


i have installed below software in system

  • vs 2017- version 15.3.3
  • node version - 6.11.3
  • angular cli version - 1.4.1

i want create component using angular cli inside angular template in vs 2017

below step doing fail achive results

  • step 1) create project angular template in vs2017
  • step 2)open cmd - create dummy ng project .angular-cli.json file outside solution
  • step 3)copy pasting .angular-cli.json file solution under below folder structure [m:\vs2017 projects\trail109\trail109]
  • step 4)changing "root": "src" "root": "clientapp"
  • step 5)then going inside solution using cd command in cmd
  • step 6)and installing angular/cli solution using given command npm install @angular/cli@latest --save-dev [m:\vs2017 projects\trail109\trail109>npm install @angular/cli@latest --save-dev]
  • step 7)after going components folders inside clientapp using cd command in cmd
  • step 8)and using given command ng g component myformname [m:\vs2017 projects\trail109\trail109\clientapp\app\components>ng g component myformname] above line gives me below given error

    error: path "clientapp/" invalid. path "clientapp/" invalid.

please missing....

vs 2017 angular template has pre rendering enabled default. if haven't disabled that, please make sure after changing root client app

  • amend .angular.cli : change follows

    "root": "clientapp",

    "outdir": "clientapp/dist",

  • amend clientapp folder follows

rename app.module.client.ts app.client.module.ts open app.client.module.ts: prepend declaration 3 dots “...” , wrap declaration in brackets.

for example: [...sharedconfig.declarations, ]

open boot-client.ts: update import use new app.client.module reference. example: import { appmodule } './app/app.client.module';


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -