×

Top 28 Angular 2 Interview Questions for 2024

1) What is Angular 2?

It is an open source JavaScript framework which is used to build web applications in JavaScript and HTML. It is also used to overcome obstacles encountered while working with Single Page applications.

2) What are the features of Angular 2?

Features of Angular 2 are:
  • Components: Helps in maintaining the application and to build the applications into many modules
  • TypeScript: TypeScript is a superset of JavaScript
  • Services: Set of code that can be shared by different components of an application

3) What are the components available in Angular 2?

The components available in Angular 2 are:
  • Modules
  • Component
  • Templates
  • Metadata
  • Service

4) What are the ways to get started with your first Angular JS application?

There are three ways to get started with your first application are:
  • Use scratch
  • Use the quick start at Angular Github
  • use Angular CLI

5)What is NgModule decorator?

NgModule decorator is used to define the declarations, imports and bootstrapping options.

6) What is Import and Export array?

Import array is used to import the functionality from other Angular JS modules. Export array is used to export directives, components and pipes.

7) What are the advantages of using Angular 2 over Angular 1?

Advantages of using Angular 2 over Angular 1:
  • Modular
  • Easy to Learn
  • Cross platform
  • Angular 2 is also a platform
  • Better Speed and Performance
  • ES6 and Typescript is also available

8) What are the lifecycle phases of Angular 2 application?

Lifecycle phases of Angular 2 application:
  • constructor
  • ngOnChanges
  • ngOnInit
  • ngDoCheck
  • ngAfterContentInit
  • ngAfterContentChecked
  • ngAfterViewInit
  • ngAfterViewChecked
  • ngOnDestroy

9) What is Routing in Angular 2?

Routing helps in enables user to navigate between views and components. Angular 2 simplifies routing and provide flexibility.

10) What is Date filter?

Date filter: It is used to convert the input string to date format.

11) What is Dependency Injection?

Dependency Injection: It is the ability to add the functionality of components at runtime.

12) What is CLI?

CLI stands for Command Line Interface, and it is used to create Angular JS application.

13) What are Angular 2 directives?

Commonly used filters are: It is a custom HTML element which is used to extend the power of HTML. Types of Angular 2 directives:
  • ngif
  • ngFor

14) Which components are used to configure routing in Angular 2?

Three main components are:
  • Routes
  • RouterOutlet
  • RouterLink

15) What are Modules in Angular 2?

Modules are used to put logical boundaries in your application. To separate the functionality of your application, you need to build everything into separate modules.

16) Which command is used to check the version of node.js in the command prompt?

The command used is: node -v.

17) Which command is used to install npm (node package manager)?

The command used is: npm install (inside Node.js command prompt).

18) What is TypeScript?

TypeScript: It is a superset of JavaScript which is used for application-scale development. TypeScript is also an object-oriented and compiled language.

19) What is Shadow Dom in Angular2?

Shadow Dom: It refers to a subtree of DOM elements which is the part of the document, but not into the main document of DOM tree. Here, the Shadow Dom is created when we are creating a component in Angular2.

20) What is Codelyzer in Angular2?

Codelyzer: It is an open source tool which is used to check whether the pre-defined coding guidelines has been followed or not.

21) What are Event Emitters in Angular2?

Event Emitters: It is a class defined in @angular/core module which is used by components and directives to emit custom events.

22) What is npm?

npm stands for node package manager. npm is a command line utility that interacts with a repository of open source projects. We can install packages, libraries and applications, along with their dependencies by using npm.

23) What is PrimeNG in Angular2?

PrimeNG: It is a collection of UI components for Angular2. It is a sibling of the popular JavaServer Faces Component Suite, PrimeFaces.

24) What is ECMAScript?

ECMAScript: It is scripting language which is used for writing server applications and services using Node.js.

25) What is Traceur in Angular2?

Traceur: It is a JavaScript compiler. This compiler is used to compile ES6 code into ES5 code. Traceur compiler supports ES5 and ES6.

26) What is ngIf in Angular2?

ngIf: It is a directive element of Angular2 that is used to add elements to the HTML code if it evaluates to true, else it will not add the elements to the HTML code.

27) Which method is used to initialize the component’s views and child views in lifecycle?

ngAfterViewInit() method.

28) What is ngAfterViewChecked() in Angular2 lifecycle?

ngAfterViewChecked(): This method is used to checks the component's views and child views.

Related Topics

Top 15 Highcharts Interview Questions for 2024

1) What is Highcharts? Highcharts is a JavaScript based charting library. It is used to enhance web applications by adding interactive charting capability. Highcharts supports a wide range of charts. Charts are drawn using...

2 minutes read.

Top 28 Scala Interview Questions for 2024

1) What is Scala? Scala is a functional and object-oriented programming language. It is used to develop web application, mobile application, enterprise application, desktop based application etc. Everything in Scala is in object...

4 minutes read.

Top 15 AWS Interview Questions for 2024

1) What is AWS? AWS stands for Amazon Web Services. It is a cloud web hosting platform that offers flexible, scalable, reliable, easy-to-use, and cost-effective solutions. 2) What is Cloud Computing? It is...

2 minutes read.

Top 15 Data structure & Algorithm Interview Questions for 2024

1) What is Data Structure? Data structure is a way of storing, collecting and organizing data into the main memory. It makes data access more efficient and increase performance. Array, List, Queue...

3 minutes read.

Ember.js Interview questions

1) What is Ember.js? Ember.js is a JavaScript front-end Framework. It provides developer both features for managing complexity in modern web-apps as well as integrated development kit. 2) Why choose Ember.js? Logical...

2 minutes read.

Top 25 DB2 Interview question for 2024

1) Give breif detail about DB2? DB2 is a Relational Database Management System developed by IBM. It supports Object Oriented features and non-relational structures with XML. 2) Enlist the types of datatypes...

3 minutes read.

Top 31 Flask Interview Questions for 2024

1) What is Flask? Flask is a micro web framework written in Python. It is based on Werkzeug toolkit and Jinja 2 template engine. 2) Who is the developer of Flask? Armin Ronacher...

6 minutes read.

Top 20 HTTP Interview Questions for 2024

1) What is HTTP? HTTP stands for Hypertext Transfer Protocol. It is a set of rules for transferring of data on WWW (World Wide Web). 2) What are the basic Features of...

4 minutes read.

Top 30 Less Interview Questions for 2024

1) What is Less? Less is a dynamic style sheet language that can be compiled in to CSS (Cascading style Sheet). It runs on client side and server side. It is...

4 minutes read.

Top 30 SQL Interview Questions for 2024

1. What is SQL? Ans. SQL stands for Structured Query Language.  It is a standard computer language for accessing, storing, and manipulating data stored in the relational database. SQL become an International Standard Organization (ISO)...

11 minutes read.

Top 25 MongoDB interview Questions for 2024

1) Give some history about MongoDB. MongoDB came into existence when data increased exponentially on the internet. Thus, maintainence of database became very difficult in structured DB. MongoDB is a NoSQL...

3 minutes read.

Top 15 Euphoria Interview Questions for 2024

1) What is Euphoria? Euphoria is a programming language. It is open source, powerful and easy to learn. It stands for End-User Programming with Hierarchical Objects for Robust Interpreted Applications 2) Who...

2 minutes read.

Top 15 Erlang Interview Questions for 2024

1) What is Erlang÷ Erlang is an open source programming language. It is used to build massively scalable soft real-time systems. It has runtime environment. It supports concurrency, fault tolerance and...

2 minutes read.

Top 16 WebGL Interview Questions for 2024

1) What is WebGL? WebGL stands for Web Graphics Library. It is a JavaScript API that is used for rendering 3D graphic in any compatible web browser. It is written in...

3 minutes read.

Top 15 JCL (Job Control Language) Interview Questions for 2024

1) What is JCL? JCL refers to Job Control Language. It is a command language which describes job (unit of work) for the Multiple Virtual Storage (MVS) operating system. It is...

3 minutes read.

PhoneGap Interview Questions 2024

Top 50 Phonegap Interview Questions with their Answers Once you have acquired practical knowledge of the PhoneGap technology, you will now be able to search for a job as a mobile...

9 minutes read.

Top 14 Apache Presto Interview Questions for 2024

1) What is Presto? Presto is a distributed SQL query engine. It is an open source software project to develop a database. 2) What are the features of Presto? There are following features...

2 minutes read.

Top 15 iOS (iPhone, iPad) Interview Questions for 2024

Top 20 Most Frequently asked iOS Interview Questions and Answers 1) What is iOS? iOS is a mobile operating system developed by Apple Inc. iOS offers iPhone and iPad application development using...

3 minutes read.

Top 15 Servlet Interview Questions for 2024

1) What is Servlet? It is a technology used to create web applications. It is a web component which is used to create dynamic web pages. It consists of many interfaces and classess...

2 minutes read.

WebSockets Interview Questions

1) What is Web Sockets? Web Sockets is a two way communication between the clients and the servers. Here, the clients and servers both the parties can communicate and exchange data...

3 minutes read.