Angular — Beginner Guide 2

Mansi Shrivastava
2 min readFeb 13, 2021

How to create a new project in Angular?

  • Angular Setup
- Go to the nodejs site https://nodejs.org/en/. And download the latest version.- npm install -g @angular/cli- ng new my-first-project- cd my-first-project- ng serve
  • Create build
ng build 
ng build --configuration=<Environment Name>

This command creates the build of the project inside the dist folder. In short, it converts all the files into js files so that browser can understand. Dist folder is the code that is deployed on the server.

How Angular application works?

  • Firstly index.html file gets loaded then Angular finds out the entry point from the configuration file angular.json, which is main.ts.

A file named angular.json at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults for build and development tools provided by the Angular CLI. Path values given in the configuration are relative to the root workspace folder.

The main entry point for your application. Compiles the application with the JIT compiler and bootstraps the application’s root module (AppModule) to run in the browser. You can also use the AOT compiler without changing any code by appending the --aot flag to the CLI build and serve commands.

  • The platformBrowserDynamic loads the root module by invoking the bootstrap module and giving it the reference to the AppModule(Root module)

@angular/platform-browser Supports execution of Angular apps on different supported browsers.

--

--

Mansi Shrivastava

I specialise in building user-friendly and visually appealing websites and applications.