### File

`src/lib/expand-row/expand-row.directive.ts`

### Metadata

Selector | `tr[rxapExpandRow]`
Standalone | `true`

### Index

###### Methods
Public onClick
###### Inputs
element
###### HostListeners
click expanded-row
###### Accessors
isExpanded

### Constructor

`constructor(expandCell: ExpandRowService<Data>)`
Defined in src/lib/expand-row/expand-row.directive.ts:22
Parameters :
Name | Type | Optional
expandCell | `ExpandRowService<Data>` | No

### Inputs

element
Type : `Data`
Required : true
Defined in src/lib/expand-row/expand-row.directive.ts:22

### HostListeners

click
Defined in src/lib/expand-row/expand-row.directive.ts:31

expanded-row
Defined in src/lib/expand-row/expand-row.directive.ts:17

### Methods

Public onClick
`onClick()`
Decorators : `@HostListener('click')`
Defined in src/lib/expand-row/expand-row.directive.ts:31
Returns : `void`

### Accessors

isExpanded
get `isExpanded()`
Defined in src/lib/expand-row/expand-row.directive.ts:17

    import {
      Directive,
      HostListener,
      Inject,
      Input,
    } from '@angular/core';
    import { ExpandRowService } from './expand-row.service';
    import { Required } from '@rxap/utilities';

    @Directive({
      selector: 'tr[rxapExpandRow]',
      standalone: true,
    })
    export class ExpandRowDirective<Data extends Record<string, any>> {

      @HostListener('expanded-row')
      public get isExpanded() {
        return this.expandCell.isExpanded(this.element);
      }

      @Input({ required: true })
      public element!: Data;

      constructor(
        @Inject(ExpandRowService)
        private readonly expandCell: ExpandRowService<Data>,
      ) {
      }

      @HostListener('click')
      public onClick() {
        this.expandCell.toggleRow(this.element);
      }

    }

# results matching ""

# No results matching ""