More About Angular Project Structure
1. "dist" folder will be create when we run 'ng build' command which we can use behind any webserver to run the entire application.
2. "src" folder : when you open src folder there will be other folder's like app, asset, environment and multiple files like main.ts, index.html etc..
app folder is something where all angular code is present, when we create any angular application we use components and modules. All these components and modules are present inside app folder.
assets folder is where all the contents which need to be rendered as it is like images go to the assets folder.
environments folder, when we develop application it need to be deployed in multiple environment like INT, QA, PROD. So all the configuration for each environments go into the environments folder.
' main.ts ' and ' index.html ' are loaded when we launch the angular application.
' polyfills.ts ' is responsible for our code to work on different browser as we different browser have different level of support, there will be chance that some javascript does not support in different browser. polyfills.ts will take care of the incapability's of different browser and make sure whatever code is written will be compatible with different browsers.
"test.ts" is the starting point for unit test when we run "ng test"
3. ' gitignore ' file contains all the files and folder which we do not want to commit .
4. package.json : we are working with multiple commands like ng serve, ng build, ng test all these need external tools and frameworks. All these frameworks and tools are defined in package.json. whatever modules we define inside package.json will be downloaded when we run 'npm install' command and all the downloaded files goes to 'node_modues' folder.
Note: ' npm install ' command is automatically executed when we create angular project by ' npm new ' command.
5. Readme.md : this is the documentation file for our Angular Application.
6. tsconfig.json file In angular application we are writing our code in typescript and our browser will not understand typescript it will only understand javascript so the code that we have written it needs to be converted to javascript, that part is present in tsconfig.json.
Comments
Post a Comment