File

projects/k-components/src/lib/components/datagridcolumn/datagridcolumn.component.ts

Implements

OnInit

Metadata

selector wm-data-grid-column
styleUrls ./datagridcolumn.component.css
templateUrl ./datagridcolumn.component.html

Index

Properties
Methods
Inputs

Inputs

Field
Type : string
Default value : ''
Header
Type : string
Default value : ''
model
Type : DataGridColumnModel

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

columnContentTemplate
Type : TemplateRef<any>
Decorators :
@ContentChild('columnContentTemplate', {static: true})
Field
Type : string
Default value : ''
Decorators :
@Input()
Header
Type : string
Default value : ''
Decorators :
@Input()
Public model
Type : DataGridColumnModel
Decorators :
@Input()
import {
  Component,
  Input,
  ContentChild,
  TemplateRef,
  OnInit,
} from '@angular/core';
import { DataGridColumnModel } from '@mobilize/wms-framework';

@Component({
  selector: 'wm-data-grid-column',
  templateUrl: './datagridcolumn.component.html',
  styleUrls: ['./datagridcolumn.component.css'],
})
export class DataGridColumnComponent implements OnInit {
  @Input()
  public model: DataGridColumnModel;

  @Input()
  Header = '';

  @Input()
  Field = '';

  @ContentChild('columnContentTemplate', { static: true })
  columnContentTemplate: TemplateRef<any>;

  ngOnInit(): void {
    this.model = this.model ?? new DataGridColumnModel();
    this.model.Header = this.Header !== '' ? this.Header : this.model.Header;
    this.model.Field = this.Field !== '' ? this.Field : this.model.Field;
    this.model.templateRef = this.columnContentTemplate;
  }
}
<div></div>

./datagridcolumn.component.css

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""