src/lib/components/table-row/table-row.component.ts
Angular Component for the TableRow Control.
ControlComponent
changeDetection | ChangeDetectionStrategy.OnPush |
selector | wm-tablerow |
styleUrls | ./table-row.component.scss |
templateUrl | ./table-row.component.html |
Properties |
|
Accessors |
constructor(refCh: ChangeDetectorRef, renderer2: Renderer2, element: ElementRef, webComponents: WebComponentsService, bringTopServ: BringTopService)
|
||||||||||||||||||
Creates an instance of TableRowComponent.
Parameters :
|
Private tableCellChildren |
Type : QueryList<TableCellComponent>
|
Default value : new QueryList<TableCellComponent>()
|
Decorators :
@ContentChildren(TableCellComponent)
|
List of TableCell components. |
tableCells |
gettableCells()
|
Gets the table cells array.
Returns :
any[]
|
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Component,
ContentChildren,
ElementRef,
Optional,
QueryList,
Renderer2
} from '@angular/core';
import { dataTransfer, BringTopService } from '@mobilize/base-components';
import { ErrorCodes, ExceptionHandlerClass } from '@mobilize/webmap-core';
import {
ControlComponent,
WebComponentsService
} from '@mobilize/winforms-components';
import { TableCellComponent } from '../table-cell/table-cell.component';
/**
* Angular Component for the TableRow Control.
*
* @export
* @class TableRowComponent
* @extends {ControlComponent}
*/
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'wm-tablerow',
templateUrl: './table-row.component.html',
styleUrls: ['./table-row.component.scss'],
inputs: ['model']
})
@dataTransfer(['tblrw'])
@ExceptionHandlerClass(ErrorCodes.Winforms)
export class TableRowComponent extends ControlComponent {
/**
* List of TableCell components.
*
* @private
* @type {QueryList<TableCellComponent>}
* @memberof TableRowComponent
*/
@ContentChildren(TableCellComponent)
private tableCellChildren: QueryList<TableCellComponent> =
new QueryList<TableCellComponent>();
/**
* Creates an instance of TableRowComponent.
*
* @param {ChangeDetectorRef} refCh
* @param {Renderer2} renderer2
* @param {ElementRef} element
* @param {WebComponentsService} webComponents
* @param {BringTopService} bringTopServ
* @memberof TableRowComponent
*/
constructor(
private refCh: ChangeDetectorRef,
private renderer2: Renderer2,
private element: ElementRef,
webComponents: WebComponentsService,
@Optional() private bringTopServ: BringTopService
) {
super(refCh, renderer2, element, webComponents, bringTopServ);
}
/**
* Gets the table cells array.
*
* @readonly
* @type {any[]}
* @memberof TableRowComponent
*/
get tableCells(): any[] {
return this.tableCellChildren.toArray();
}
}
<ng-content></ng-content>
./table-row.component.scss