Preliminary discussion on angularjs6.x---directory structure description

Source: Internet
Author: User

Preliminary discussion on angularjs6.x---directory structure description In the previous article we carried out the basic environment of the angularjs6.x, and tried to build a project conk-out, today we will do some expansion on this project. Our project code includes angular components, templates, style files, pictures, and other things we write ourselves in SRC, which is the same as Java, and some directories and files outside of this directory help us build the project, so we can do it for the time being. You can use TREESRC /command displays all directories and files in the SRC directory as a tree, as shown in:

  In the app we see a series of things related to the app, if we look at the code inside we will find that they mainly use HTML template, style file, built a appcomponent, of course, there is a unit test. The components here can be said to be a root component, It can be understood that the project starts here, the other components are based on appcomponent, and I prefer to turn him into a canvas or a portal. App.module.ts in the app directory, he tells angular how to encapsulate or render our app, and now we look at it,  We'll find out that he only introduced a app.component, and later as the business changes, we declare that more and more components are being introduced.  In the Assert, here we can put some pictures or other files that we use when building the project.  The browserslist mainly stores the configuration files of the target browsers that are shared in different front-end tools.  Environments This is primarily a different configuration for different environments (dev/test/production), and he will be dynamically replaced when we build. This is the equivalent of using MAVEN's profile in Java, and different environments activate different profiles.  Favicon.ico: website title on the small icon index.html: The first page of the project, in the construction, angular will give us the automatic addition of JS and CSS, generally do not need us to manually edit. Karma.conf.js: For Karmatestrunner configuration, we can use Ngtest to run the main.ts: that is, the entry that uses Jitcompiler to compile the project,  It is also the portal that loads the project's root module while it is running in the browser. We can also specify that the compiler is aopcompiler by appending the-aot parameter when building and starting the project, and no need to change any code. Polyfills.ts: Different browsers have different levels of support for web standards.  Polyfills helps us standardize these different places.  Styles.css: This is the global CSS, the changes here will affect the entire app style.  Test.ts: The entrance to the unit test, there may be some customary configuration will be more unfamiliar, generally we will not edit this file. Tsconfig. {The App|spec}.json:typescript compiler prepares configurations for Angularapp and unit tests (Tsconfig.spec.json) Tslint.json:Linting help us keep our code consistent, And the Tslint.json is for Tslint andCodelyzer some additional configurations to prepare. Today's catalogue description is here.

  

Preliminary discussion on angularjs6.x---directory structure description

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.