Angular 5 Interview Questions

  1. What Is Angular 5? Whats new in it?
  2. What an Angular 5 component made of ? How do you generate a new component?
  3. How to run Angular 5 application locally during development?
  4. List the types of Data Binding supported by Angular 5?
  5. Explain Bootstrapping in AngularJs?
  6. Explain $event in Angular5?
  7. What do double curly brackets are used in Angular5?
  8. What is *ngFor directive used for?
  9. Explain Webpack?
  10. What is transpiling?
  11. Explain component life cycle in Angular?
  12. How do we import a module in Angular5 ?
  13. Explain NgModule?
  14. What are Decorators?
Angular 5 Interview Questions

Find Top Angular 5 interview questions and answers

Below are the list of angular 5 interview questions and their answers

Download Angular 5 Interview Questions PDF

Angular5 component is made of a Component decorator and a component definition of a class. ng generate component component_name command is used to generate a component in Angular5.

ng serve command is used to run Angular5 application locally during development. To start development server on specific port ng serve -p aPortNumber command is used.

Also, Read Best  Angular 2 interview questions 2017

 

Angular 5 supports four types of Data Binding They are

  • String Interpolation
  • Property Binding
  • Event Binding
  • Two-way-binding

AngularJS reads the HTML and compiles it into an internal representation, this reading and compiling is called bootstrapping.

When you write the code to execute the bootstrapping instead of using ng-app directive then it is called manual bootstrapping.

In Angular5 $event is a reserved keyword that represents the data emitted by an event (event data).It is commonly used as a parameter for event based methods.

 double curly brackets like {{}} are used form data interpolation in Angular5.

*ngFor directive is used for Iterating over a list of items and for Generating a new DOM element for each one.

Webpack is module bundler Bundler for Angular2 or above. It bundles, minifies and transpiles an Angular application.

Transpiling is a process of converting code from one language to another. In Angular, Traceur compiler is used for converting TypeScript to JavaScript so that browsers can understand.

Also, Read Interview questions asked in React Js  Interviews

 In Angular component life cycle in Angular goes through the following stages.

  • Create
  • Render
  • Create and render children
  • Check for bound data changes and re-render
  • Destroy

Simply use below syntax to import a module in Angular5.


	import { ModuleName } from 'someWhere';
	

NgModule is a decorator function in Angular that takes a single metadata object whose properties describe the module.

Decorators are functions that adds metadata to class members and functions. It was proposed in ES2016 and implemented in Typescript.

After installing Angular CLI run ng new project-name command to create a new Angular project.

 

Angular CLI is Command Line Interface for Angular that runs Webpack.You can use npm install -g @angular/cli command to install angular CLI.

 NPM stands for node package manager. It is used for installing dependencies for javascript packages.