0% found this document useful (0 votes)
2 views

Angular Interview Question

The document provides a comprehensive overview of Angular, a TypeScript-based front-end web application framework maintained by Google, primarily used for building single-page applications (SPAs). It covers key concepts such as components, modules, directives, data binding, and routing, explaining their roles and functionalities within Angular applications. Additionally, it discusses various types of directives and data binding methods, including one-way and two-way binding, as well as the use of metadata and parameterized pipes.

Uploaded by

bhamrekashyap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Angular Interview Question

The document provides a comprehensive overview of Angular, a TypeScript-based front-end web application framework maintained by Google, primarily used for building single-page applications (SPAs). It covers key concepts such as components, modules, directives, data binding, and routing, explaining their roles and functionalities within Angular applications. Additionally, it discusses various types of directives and data binding methods, including one-way and two-way binding, as well as the use of metadata and parameterized pipes.

Uploaded by

bhamrekashyap
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

*****Angular interview Question*****

1) What is angular.
• Ans= Angular is a typescript-based front-end
web application framework.
• Its targets both the browser and server.
• This application maintains by google.
• The primary function is to design single page
application.
• It allows developers to create large,
maintainable applications.
2) What are single page application.
• Ans= A single-page application is an app that
doesn’t need to reload the page during its use
and works within a browser. Think of the apps
you use daily: Facebook, Google Maps, Gmail,
Twitter, Google Drive, or even GitHub. All
these are examples of a SPA.
3) What are template in angular.
• In angular template is a part od HTML .use
special syntax within templates to create
many of angular features.
• There are two ways to create a template in
angular component.
• Inline template
➢ The component decorators template
config is used to specify an inline html
template for a component.
• Linked template
➢ A component may include an html
template in separate html file.
• Template URL option used to indicate the path
of html template file,
4) What are directives in angular.
• Directive is a class in angular that is
declared with a @Directive decorator.
• Every directive has its own behaviour and
can be imported into various components
of an application.
5) Types of directives.
• There are three types of directives.
• Component Directives: Component directives are used
in main class. They contain the detail of how the
component should be processed, instantiated and used
at runtime.

• Structural Directives: Structural directives start


with a * sign. These directives are used to
manipulate and change the structure of the DOM
elements. For example, *ngIf directive, *ngSwitch
directive, and *ngFor directive.
• Attribute Directives: Attribute directives are
used to change the look and behaviour of the
DOM elements. For example: ngClass directive,
and Ng Style directive etc.

6) What is component .

• Ans = angular components are the basic


building blocks, which control a part of the Ui for
any application.
• A component is defined using the @component
decorator.
• Every component consist of three party ,the
template which loads the view for component,
and stylesheet which defines the look and feel
for the component ,and class that contains the
business logic for the component.

7) What is module

Ans=Module in Angular refers to a place where you


can group the components, directives, pipes, and
services, which are related to the application. In case
you are developing a website, the header, footer, left,
centre and the right section become part of a
module. To define module, we can use the Ng
Module.

8) What is data binding in angular.

• Ans= data binding is one of most significant and


effective elements for creating communication
between the Dom and component.
7)four types of data binding .

➢ Interpolation.

✓ Interpolation is a one-way data


binding method.
✓ Using interpolation, we can transfer
data from ts to html.
✓ Its denoted by double curly braces
{{}}.

➢ Property binding.

Property binding: [property]=”value”: The value is


passed from the component to the specified property or
simple HTML attribute

✓ This is also one way binding.


✓ property binding is used to pass data
from the component class.
✓ Denoted by square brackets [ ]

➢ Event Binding

✓ Event binding is a one-way data binding


method.
✓ It transferer data html to ts.
✓ that allows you to respond to user
events (such as clicks, mouseovers,
✓ . It's denoted by parentheses ( ).

9) What is two way binding.


✓ In two way data binding, property binding and
event binding are combined together.
✓ In two-way databinding, automatic
synchronization of data happens between the
Model and the View
✓ In two-way databinding, automatic
synchronization of data happens between the
Model and the View

10)

What exactly is a parameterized pipe?

In Angular, a parameterized pipe is a pipe that takes one


or more parameters, which are also referred to as
arguments. Pipes are used in Angular templates to
change data; parameterized pipes let you adjust the
transformation according to certain needs. A pipe's
behavior can be changed and various data
transformations can be applied by handling its
parameters.

11)What is hooks

The hooks give you the opportunity to act on a


component or directive instance at the appropriate
moment, as Angular creates, updates, or destroys that
instance
12) Routing in Angular is a way to navigate between
different views or components within a single-page
application (SPA) without reloading the page. It involves
defining routes (paths) and associating them with
components, using the RouterModule, Routes, and
<router-outlet> to display the appropriate component
based on the URL. This allows for a seamless and dynamic
user experien

What is Routing in AngularJS?

If you want to navigate to different pages in your


application, but you also want the application to be a SPA
(Single Page Application), with no page reloading, you
can use the ngRoute module.

13) what is meta data.

Metadata is used to decorate a class so that it can


configure the expected behaviour of the class. The
metadata is represented by decorators

14) what is rounting

Routing in Angular is a way to navigate between different


views or components within a single-page application
(SPA) without reloading the page. It involves defining
routes (paths) and associating them with components,
using the Rou8terModule, Routes, and <router-outlet>
to display the appropriate component based on the URL.
This allows for a seamless and dynamic user experience.

You might also like