Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Angular 5 Interview Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3
At a glance
Powered by AI
Some of the key takeaways from the document are that Angular is a framework for building client-side web applications, it supports data binding, components, modules and uses TypeScript. Angular CLI is used to generate components and projects.

The main components of an Angular application are modules, components, templates, and services. Modules are used to group related code, components define the UI, templates contain the markup, and services contain reusable business logic.

Some of the main directives in Angular are NgFor for iteration, NgIf for conditional display, NgClass for dynamic classes, NgStyle for dynamic styles, and NgModel for two-way data binding between forms and components.

Angular 5 Interview Questions

Find Top Angular 5 interview questions and answers


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

Q1. What Is Angular 5? Whats new in it?

Q2. Explain Bootstrapping in AngularJs?

Q3. Explain service workers in Angular js?

Q4. Explain how component routing works in Angular. How to define routes and sub-
routes in Angular 5?

Q5. Explain NPM?

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

Q6. What is Angular CLI? List the command to install Angular CLI?

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

Q7. How to create a new project in angular js using CLI.

After installing Angular CLI run ng new project-name command to create a new Angular project.
Q8. What are Decorators?

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

Q9. List the types of Data Binding supported by Angular 5?

Angular 5 supports four types of Data Binding They are

String Interpolation
Property Binding
Event Binding
Two-way-binding

Q10. How to run Angular 5 application locally during development?

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

Q11. What an Angular 5 component made of ? How do you generate a new component?

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.

Q12. How do we import a module in Angular5 ?

Simply use below syntax to import a module in Angular5.

import { ModuleName } from 'someWhere';

Q13. Explain $event in Angular5?

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.

Q14. What do double curly brackets are used in Angular5?

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

Q15. What is *ngFor directive used for?

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

Q16. Explain Webpack?

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

Q17. What is transpiling?

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

Q18. Explain component life cycle in Angular?

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

Q19. Explain NgModule?

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

You might also like