Posts Angular Interview questions
Post
Cancel

Angular Interview questions

1. Why were client-side frameworks like Angular introduced?

Angular allows one to develop advanced web applications like Single-Page-Application. It makes life easier for the developers by handling separation of concerns and dividing code into smaller bits of information (In the case of Angular, called Components).

2. How does an Angular application work?

  • Which file contains all the configurations of the app? angular.json
  • What defines the entry point of the application? Inside the build section, the main property of the options object
    1
    2
    3
    4
    5
    6
    7
    
      "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
          "outputPath": "dist/angular-starter",
          "index": "src/index.html",
          "main": "src/main.ts",
          "polyfills": "src/polyfills.ts",
    
  • What’s the purpose of main.ts? It creates a browser environment for the application to run and calls a function called bootstrapModule, which bootstraps the application.
      platformBrowserDynamic().bootstrapModule(AppModule)
    
  • What does AppModule? AppModule is getting bootstrapped as shown above. It’s a module class defined in the app.module.ts file. This module contains declarations of all the components.
This post is licensed under CC BY 4.0 by the author.