Angular Interview Practice

Image Description

Question: 1 / 400

Which of the following is NOT one of the three types of directives in Angular?

Component directives

Structural directives

Event directives

In Angular, directives are used to extend the functionality of HTML elements. There are three main types of directives: component directives, structural directives, and attribute directives.

Component directives are essentially components themselves, encapsulating a template, styles, and logic, and they are represented in the code by a selector that allows the component to be used as an HTML tag.

Structural directives are responsible for altering the DOM layout by adding or removing elements based on certain conditions. Common examples include directives like *ngIf and *ngFor, which control whether elements should appear in the DOM based on data conditions.

Attribute directives, on the other hand, are used to modify the appearance or behavior of an existing DOM element without changing the layout. They can change the style of an element or respond to events.

C, which is "event directives," is not a recognized category within Angular. While Angular does handle events (such as click events) through event binding, these are not categorized as a separate type of directive. Instead, such functionality typically utilizes attribute directives but does not have its own distinct classification within Angular's directive system.

Get further explanation with Examzify DeepDiveBeta

Attribute directives

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy