Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Angular Directives

30

Flashcards

0/30

Still learning
StarStarStarStar

ngFor

StarStarStarStar

A structural directive that renders a template for each item in a collection. Usage: <li *ngFor="let item of items">{{ item }}</li>.

StarStarStarStar

ngIf

StarStarStarStar

Conditionally includes a template block in the DOM based on the truthiness of the expression provided. Usage: <div *ngIf="condition">Content to display if condition is true</div>.

StarStarStarStar

ngStyle

StarStarStarStar

Allows you to dynamically set inline styles based on the condition provided. Usage: <div [ngStyle]="{'font-size': '12px', 'color': condition ? 'blue' : 'red'}">...</div>.

StarStarStarStar

ngSwitch

StarStarStarStar

Facilitates the switching between nested templates based on some condition akin to a switch statement. Usage: <div [ngSwitch]="expression"> <template *ngSwitchCase="matchValue">...</template></div>.

StarStarStarStar

ngClass

StarStarStarStar

Dynamically assigns CSS classes to an element based on conditions or object map. Usage: <div [ngClass]="{'class-name': condition}">...</div>.

StarStarStarStar

ngModel

StarStarStarStar

Provides two-way data-binding between HTML form elements and component data. Usage: <input [(ngModel)]="propertyName">.

StarStarStarStar

ngContainer

StarStarStarStar

Serves as a group placeholder that doesn't interfere with styles or layout because Angular doesn't put it in the DOM. Usage: <ng-container>...</ng-container>.

StarStarStarStar

ngPlural

StarStarStarStar

Facilitates localization of ordinal numbers, rendering templates based on the value of the provided expression. Usage: <div [ngPlural]="value">...</div>.

StarStarStarStar

ngTemplateOutlet

StarStarStarStar

Used to insert an embedded view from a prepared TemplateRef. Usage: <ng-container *ngTemplateOutlet="templateRef"></ng-container>.

StarStarStarStar

ngContent

StarStarStarStar

Denotes where to insert transcluded content within a component's template. Usage: <ng-content select=".my-class"></ng-content>.

StarStarStarStar

ngAfterViewChecked

StarStarStarStar

A lifecycle hook that is called after the component's view and its child views have been checked. Defined as a method within a component class.

StarStarStarStar

ngHost

StarStarStarStar

Special directive that applies styles to the hosting element of the component. Usage is implicit, and styles are defined within the component's styles.

StarStarStarStar

ngOnInit

StarStarStarStar

A lifecycle hook that is called after Angular has initialized all data-bound properties of a directive. Defined as a method within a component class.

StarStarStarStar

ngOnDestroy

StarStarStarStar

A lifecycle hook that is called just before the directive is destroyed, used for cleanup. Defined as a method within a component class.

StarStarStarStar

ngTemplate

StarStarStarStar

Defines an inline template that can be used by ngTemplateOutlet and other directives. Usage: <ng-template #templateRef>...</ng-template>.

StarStarStarStar

ngAfterViewInit

StarStarStarStar

A lifecycle hook that is called after a component's view and its child views are initialized. Defined as a method within a component class.

StarStarStarStar

ngHostBinding

StarStarStarStar

A property decorator that is used to bind a host element property to a directive's property. Usage: @HostBinding('attr.role') role = 'button';

StarStarStarStar

ngSwitchCase

StarStarStarStar

Used within ngSwitch to match a case and display its associated content. Usage: <div *ngSwitchCase="'caseValue'">...</div>.

StarStarStarStar

ngSwitchDefault

StarStarStarStar

Specifies the default case to display when no ngSwitchCase matches in ngSwitch directive. Usage: <div *ngSwitchDefault>Default case content</div>.

StarStarStarStar

ngDoCheck

StarStarStarStar

A lifecycle hook that is called to check for changes in the directive or component. Defined as a method within a component class.

StarStarStarStar

ngHostListener

StarStarStarStar

A method decorator that declares a DOM event to listen for, and provides a handler method to run when that event occurs. Usage: @HostListener('click', ['event])onClick(event)event']) onClick(event) {}

StarStarStarStar

ngViewChild

StarStarStarStar

A property decorator that configures a view query. Usage: @ViewChild('childDirective') childDirective: ElementRef;

StarStarStarStar

ngAfterContentInit

StarStarStarStar

A lifecycle hook that is called after the directive's content is fully initialized. Defined as a method within a component class.

StarStarStarStar

ngComponentOutlet

StarStarStarStar

Dynamically instantiates a component and injects it into the template at the specified location. Usage: <ng-container *ngComponentOutlet="componentType"></ng-container>.

StarStarStarStar

ngContentChildren

StarStarStarStar

A property decorator that is used to get the QueryList of elements or directives from the content DOM. Usage: @ContentChildren(ChildDirective) contentChildren: QueryList<ChildDirective>;

StarStarStarStar

ngPluralCase

StarStarStarStar

Used with ngPlural to specify content for different plural categories. Usage: <template ngPluralCase="'one'">Single item</template>.

StarStarStarStar

ngAfterContentChecked

StarStarStarStar

A lifecycle hook that is called after the content of a directive has been checked by Angular's change detection. Defined as a method within a component class.

StarStarStarStar

ngViewChildren

StarStarStarStar

A property decorator that configures a view query for a set of elements. Usage: @ViewChildren(ChildDirective) childDirectives: QueryList<ChildDirective>;

StarStarStarStar

ngNonBindable

StarStarStarStar

Tells Angular not to compile or bind the contents of the current DOM element. Usage: <div ngNonBindable>{{ ignoreBinding }}</div>.

StarStarStarStar

ngOnChange

StarStarStarStar

A lifecycle hook that is called when a data-bound property of a directive changes. Defined as a method within a component class.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.