File

src/lib/select-row/checkbox-cell/checkbox-cell.component.ts

Metadata

Index

Properties
Inputs

Constructor

constructor(selectRow: SelectRowService<Data>)
Parameters :
Name Type Optional
selectRow SelectRowService<Data> No

Inputs

element
Type : Data
Required :  true

Properties

Public Readonly selectRow
Type : SelectRowService<Data>
Decorators :
@Inject(SelectRowService)
import {
  ChangeDetectionStrategy,
  Component,
  Inject,
  Input,
} from '@angular/core';
import { Required } from '@rxap/utilities';
import { SelectRowService } from '../select-row.service';
import { MatCheckboxModule } from '@angular/material/checkbox';

@Component({
    // eslint-disable-next-line @angular-eslint/component-selector
    selector: 'td[rxap-checkbox-cell]',
    templateUrl: './checkbox-cell.component.html',
    styleUrls: ['./checkbox-cell.component.scss'],
    changeDetection: ChangeDetectionStrategy.Default,
    imports: [MatCheckboxModule]
})
export class CheckboxCellComponent<Data extends Record<string, any>> {

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

  constructor(
    @Inject(SelectRowService)
    public readonly selectRow: SelectRowService<Data>,
  ) {
  }

}
<mat-checkbox
  (change)="selectRow.selectionModel.toggle(element)"
  [checked]="selectRow.selectionModel.isSelected(element)">
</mat-checkbox>

./checkbox-cell.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""