File

src/lib/components/table-cell/table-cell.component.ts

Description

Angular Component for the TableCell Control.

Extends

ControlComponent

Metadata

Index

Properties
Methods

Constructor

constructor(wmService: WebMapService, refCh: ChangeDetectorRef, renderer2: Renderer2, element: ElementRef, webComponents: WebComponentsService, bringTopServ: BringTopService)

Creates an instance of TableCellComponent.

Parameters :
Name Type Optional
wmService WebMapService No
refCh ChangeDetectorRef No
renderer2 Renderer2 No
element ElementRef No
webComponents WebComponentsService No
bringTopServ BringTopService No

Methods

getModels
getModels()

Returns the models of the controls inside the cell.

Returns : any

{*}

Properties

controlsTemplate
Type : TemplateRef<any>
Decorators :
@ContentChild('ControlsTemplate')

Controls inside the cell reference.

import {
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  ContentChild,
  ElementRef,
  Optional,
  Renderer2,
  TemplateRef
} from '@angular/core';
import { dataTransfer, BringTopService } from '@mobilize/base-components';
import { ErrorCodes, ExceptionHandlerClass } from '@mobilize/webmap-core';
import { WebMapService } from '@mobilize/angularclient';
import {
  ControlComponent,
  WebComponentsService
} from '@mobilize/winforms-components';

/**
 * Angular Component for the TableCell Control.
 *
 * @export
 * @class TableCellComponent
 * @extends {ControlComponent}
 */
@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'wm-tablecell',
  templateUrl: './table-cell.component.html',
  styleUrls: ['./table-cell.component.scss'],
  inputs: ['model']
})
@dataTransfer(['tblcll'])
@ExceptionHandlerClass(ErrorCodes.Winforms)
export class TableCellComponent extends ControlComponent {
  /**
   * Controls inside the cell reference.
   *
   * @type {TemplateRef<any>}
   * @memberof TableCellComponent
   */
  @ContentChild('ControlsTemplate')
  controlsTemplate!: TemplateRef<any>;

  /**
   * Creates an instance of TableCellComponent.
   *
   * @param {WebMapService} wmService
   * @param {ChangeDetectorRef} refCh
   * @param {Renderer2} renderer2
   * @param {ElementRef} element
   * @param {WebComponentsService} webComponents
   * @param {BringTopService} bringTopServ
   * @memberof TableCellComponent
   */
  constructor(
    private wmService: WebMapService,
    private refCh: ChangeDetectorRef,
    private renderer2: Renderer2,
    private element: ElementRef,
    webComponents: WebComponentsService,
    @Optional() private bringTopServ: BringTopService
  ) {
    super(refCh, renderer2, element, webComponents, bringTopServ);
  }

  /**
   * Returns the models of the controls inside the cell.
   *
   * @return {*}  {*}
   * @memberof TableCellComponent
   */
  getModels(): any {
    const models: any = {};
    /* c8 ignore else*/
    if (this.model?.Controls) {
      Object.keys(this.model.Controls).forEach((key) => {
        const model = this.wmService.core.getModel(key);
        const name = model?.Name;
        /* c8 ignore else*/
        if (name) {
          models[name] = model;
        }
      });
    }
    return models;
  }
}
<ng-content></ng-content>

./table-cell.component.scss

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""