Thursday, 11 March 2021

Angular Interview Questions part II

 1.Differentiate between dependencies and dev dependencies.

 Dependencies are properties that are used in a project that makes program run smoothly. They are used for testing, building and compiling the program. 

 Dev dependencies contains names and versions of the node  modules that are required for the development purpose only.

The main difference between dependencies and dev dependencies are the dependencies are modules which are required at runtime, while dev dependencies are modules which are only used for development purpose.


2.Explain about view, components, modules and models?

View: View is a presentation layer that defines how your user sees and interact with it.

Components: Components are the intermediate building block of angular applications that are used to bind view and model together. Any information is shared between view and model through the components.

Modules: Module is a mechanism that group components, directives, pipes and services that can be combined with other modules to create an application.

Models: Models are used in business logic concept that interact with view through components.


3.What is the industry naming convention for angular file and folder?

It becomes very hard to manage all files and folders without following any standard naming convention. So angular also follows the naming convention that helps to manage and debug lots of files and folders easily. In angular, each folder has its own view, component, module and models.

The folder structure of an angular project is:



4. How does angular application bootstrap ( start )?

Bootstrapping is a technique of initializing or loading angular application. When we create a new angular project then it is launched by using command ng serve . Bootstrap describe how our AppComponent get loaded and displays our first view. It follows following steps in sequence order:

  1. Index.html loads first
  2. index.html file call the main.ts file  
  3. main.ts file bootstraps the app.module.ts file
  4. app.module.ts file calls the app.component.ts file
  5. app.component.ts loads its view app.component.html
  6. app.component.html template is injected to the index.html file then we sees our 1st view on the browser.

5. What is a decorator?

Decorators are functions that are used to separate modification or decoration of a class without modifying the original source code. It makes a class an angular component and adds additional metadata information like template, selector name style etc.  on it.


6. What is a selector?

Selector is a parameter of a decorator which is used to identify each component uniquely into the component tree. It helps to inject the component to the index.html file.


7. Explain the importance of templateURL?

TemplateURL has the path of the HTML code file. In a complex view selector is not enough, we also need to specify the path where our view resides that need to be injected into index.html through the selector.


Video tutorial for angular:



No comments:

Post a Comment