Detailed Angular CLI Configuration Process Record

1. First call the command line tool, run the command globally installed angular -Cli

  NPM I -G @ Angular / CLI  

In the installation process, there is a warning and error message in my command line tool. I don’t have any trouble. Because I didn’t encounter any trouble in subsequent use.

After the installation is complete, you can pass the installed version information by command line NG V, I am such a

 _ _ ____ _ ___ / \ _ __ __ _ _ _ | | __ _ _ __ / ___ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ___ \ | | | | (_ | | | | | ___ | | ___ | | | / _ / \ _ \ _ | | | _ | __, | \ __, _ | _ | \ __, _ | ______ | ___ | | ___ / angular cli: 8.3.3Node: 10.16.3os: darwin x64angular: ... package version ---------------- ---------------------------------------- @ Angular-Devkit / Architect 0.803.3 @ Angular-devkit / core 8.3.3@angular-devkit/schematics 8.3.3@schematics/angular 8.3.3@schematics/Update 0.803.3rxjs 6.5.3   Seeing this means that there is basically no problem, it has been globally successfully installed Angular-CLI 
2. Use the command line NG New myApp to generate projects, and the selection of some configuration options during the process will choose different configurations according to their needs.
I chose to use Angular Routing and Less


? Would you like to add angular routing? Yes? Which stylesheet format would you like to use? Less

Waiting for installation, installation The directory is such a
   

Open the project, run the command line ng serve –Open, Angular- The CLI will automatically run in the browser. The interface I run is like this: 详解Angular cli配置过程记录

Angular-CLI installation completed the first operation result map

This new project is created such that new projects is completed.


详解Angular cli配置过程记录

Node_Modules


Node_Modules file directory is the dependency of our project, which is usually put in .gitignore file, like this


/ Node_MODULES

In a project created using Angular-Cli, it will automatically help me do the files that require git ignoring.

When the MyApp project is pulled from Git, there is no node_modules directory, run the command line NPM I or NPM INSTALL to re-download Node_Modules directory

SRC
 The SRC directory is generally placed in the source code of our project. When you start, you have these things   

SRC directory content

index.html file is an entry file of the project, in this file

, only

entry points. This is what said above? Would you like to add angular routing? This problem chosen the result of YES,
is a routing component of Angular


main.ts After the package is automatically introduced into the JS file

prompt: if you want to use the NGModel binding input box content, you need to introduce the FormsModule module in … app.Component.ts, then put it in the introduction Content Import“` attribute 详解Angular cli配置过程记录

Import {formsmodule} from ‘@ Angular / Forms’; imports: [*** formsmodule],

The above is all of this article, I hope to help everyone, I hope everyone will support Tumi Clouds.

© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment