@rxap/directives
Version:
This package provides a set of Angular directives to simplify common tasks such as setting background images, confirming clicks, making elements contenteditable, and more. It includes directives for handling UI interactions, applying styles, and managing
170 lines (87 loc) • 3.93 kB
Markdown
[**@rxap/directives v19.0.4**](../README.md)
***
[@rxap/directives](../globals.md) / IfTruthyDirective
# Class: IfTruthyDirective\<Data, Parameters\>
Defined in: [if-truthy.directive.ts:22](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L22)
## Type Parameters
• **Data**
• **Parameters** = `any`
## Implements
- `OnChanges`
## Constructors
### new IfTruthyDirective()
> **new IfTruthyDirective**\<`Data`, `Parameters`\>(`templateRef`, `viewContainerRef`, `cdr`): [`IfTruthyDirective`](IfTruthyDirective.md)\<`Data`, `Parameters`\>
Defined in: [if-truthy.directive.ts:32](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L32)
#### Parameters
##### templateRef
`TemplateRef`\<[`IfTruthyDirectiveTemplateContext`](../interfaces/IfTruthyDirectiveTemplateContext.md)\<`Data`\>\>
##### viewContainerRef
`ViewContainerRef`
##### cdr
`ChangeDetectorRef`
#### Returns
[`IfTruthyDirective`](IfTruthyDirective.md)\<`Data`, `Parameters`\>
## Properties
### method
> **method**: `Method`\<`Data`, `Parameters`\>
Defined in: [if-truthy.directive.ts:25](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L25)
***
### parameters
> **parameters**: `Parameters`
Defined in: [if-truthy.directive.ts:27](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L27)
***
### trackBy()
> **trackBy**: (`data`) => `any`
Defined in: [if-truthy.directive.ts:29](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L29)
#### Parameters
##### data
`Data`
#### Returns
`any`
## Methods
### execute()
> `protected` **execute**(): `Promise`\<`void`\>
Defined in: [if-truthy.directive.ts:60](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L60)
#### Returns
`Promise`\<`void`\>
***
### hasChanged()
> `protected` **hasChanged**(`current`): `boolean`
Defined in: [if-truthy.directive.ts:78](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L78)
#### Parameters
##### current
`Data`
#### Returns
`boolean`
***
### ngOnChanges()
> **ngOnChanges**(`changes`): `void`
Defined in: [if-truthy.directive.ts:52](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L52)
A callback method that is invoked immediately after the
default change detector has checked data-bound properties
if at least one has changed, and before the view and content
children are checked.
#### Parameters
##### changes
`SimpleChanges`
The changed properties.
#### Returns
`void`
#### Implementation of
`OnChanges.ngOnChanges`
***
### ngTemplateContextGuard()
> `static` **ngTemplateContextGuard**\<`T`\>(`dir`, `ctx`): `ctx is IfTruthyDirectiveTemplateContext<T>`
Defined in: [if-truthy.directive.ts:45](https://gitlab.com/rxap/packages/-/blob/3eebed1be2bbb37bc0d65959f8fecbb850c0b8aa/packages/angular/directives/src/lib/if-truthy.directive.ts#L45)
Asserts the correct type of the context for the template that `NgForOf` will render.
The presence of this method is a signal to the Ivy template type-check compiler that the
`NgForOf` structural directive renders its template with a specific context type.
#### Type Parameters
• **T**
#### Parameters
##### dir
[`IfTruthyDirective`](IfTruthyDirective.md)\<`T`\>
##### ctx
`any`
#### Returns
`ctx is IfTruthyDirectiveTemplateContext<T>`