Angular Flashcards

1
Q

What is Angular?

A

Angular was introduced to create Single Page applications. This framework brings structure and consistency to web applications and provides excellent scalability and maintainability.

Angular is an open-source, JavaScript framework wholly written in TypeScript. It uses HTML’s syntax to express your application’s components clearly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is TypeScript?

A

TypeScript is a superset of JavaScript that offers excellent consistency. It is highly recommended, as it provides some syntactic sugar and makes the code base more comfortable to understand and maintain. Ultimately, TypeScript code compiles down to JavaScript that can run efficiently in any environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is data binding?

A

Data binding is a phenomenon that allows any internet user to manipulate Web page elements using a Web browser. It uses dynamic HTML and does not require complex scripting or programming. We use data binding in web pages that contain interactive components such as forms, calculators, tutorials, and games. Incremental display of a webpage makes data binding convenient when pages have an enormous amount of data.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which type of data binding does Angular deploy?

A

Angular uses the two-way binding. Any changes made to the user interface are reflected in the corresponding model state.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are Single Page Applications (SPA)?

A

Single-page applications are web applications that load once with new features just being mere additions to the user interface. It does not load new HTML pages to display the new page’s content, instead generated dynamically. This is made possible through JavaScript’s ability to manipulate the DOM elements on the existing page itself. A SPA approach is faster, thus providing a seamless user experience.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are decorators in Angular?

A

Decorators are a design pattern or functions that define how Angular features work. They are used to make prior modifications to a class, service, or filter. Angular supports four types of decorators, they are:

Class Decorators
Property Decorators
Method Decorators
Parameter Decorators

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Directives in Angular?

A

Directives are attributes that allow the user to write new HTML syntax specific to their applications. They execute whenever the Angular compiler finds them in the DOM. Angular supports three types of directives.

Component Directives
Structural Directives
Attribute Directives

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is an ngModule?

A

NgModules are containers that reserve a block of code to an application domain or a workflow. @NgModule takes a metadata object that generally describes the way to compile the template of a component and to generate an injector at runtime. In addition, it identifies the module’s components, directives, and pipes, making some of them public, through the export property so that external components can use them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the lifecycle hooks in Angular

A

In Angular, every component has a lifecycle. Angular creates and renders these components and also destroys them before removing them from the DOM. This is achieved with the help of lifecycle hooks. Here’s the list of them -

ngOnChanges() - Responds when Angular sets/resets data-bound input properties.
ngOnInit() - Initialize the directive/component after Angular first displays the data-bound properties and sets the directive/component’s input properties/
ngDoCheck() - Detect and act upon changes that Angular can’t or w

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is String Interpolation in Angular?

A

String Interpolation is a one-way data-binding technique that outputs the data from TypeScript code to HTML view. It is denoted using double curly braces. This template expression helps display the data from the component to the view.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly