projects/i-components/src/lib/components/list-box-item/list-box-item.component.ts
Angular Component for the ListBox item Control
changeDetection | ChangeDetectionStrategy.OnPush |
selector | wm-list-box-item |
styleUrls | ./list-box-item.component.scss |
templateUrl | ./list-box-item.component.html |
Properties |
|
Methods |
Inputs |
Public
constructor(injectedModel: ListBoxItemModel)
|
||||||
Creates an instance of ListBoxItemComponent.
Parameters :
|
model | |
Type : ListBoxItemModel
|
|
Object with ListBoxItem properties and events |
ngOnInit |
ngOnInit()
|
Angular lifecycle hook Initialize model
Returns :
void
|
Public model |
Type : ListBoxItemModel
|
Decorators :
@Input()
|
Object with ListBoxItem properties and events |
import {
ChangeDetectionStrategy,
Component,
Input,
OnInit,
Optional,
} from '@angular/core';
import {
ListBoxItemModel,
ComponentId,
AngularComponentId,
} from '@mobilize/wms-framework';
/**
* Angular Component for the ListBox item Control
*
* @export
* @class ListBoxItemComponent
* @implements {OnInit}
*/
@Component({
selector: 'wm-list-box-item',
templateUrl: './list-box-item.component.html',
styleUrls: ['./list-box-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
@ComponentId([AngularComponentId.listBoxItem])
export class ListBoxItemComponent implements OnInit {
/**
* Object with ListBoxItem properties and events
*
* @type {ListBoxItemModel}
* @memberof ListBoxItemComponent
*/
@Input()
public model: ListBoxItemModel;
/**
* Creates an instance of ListBoxItemComponent.
*
* @param {ListBoxItemModel} injectedModel
* @memberof ListBoxItemComponent
*/
public constructor(@Optional() private injectedModel: ListBoxItemModel) {
this.model = injectedModel;
}
/**
* Angular lifecycle hook
* Initialize model
*
* @memberof ListBoxItemComponent
*/
ngOnInit(): void {
this.model = this.model || this.injectedModel || new ListBoxItemModel();
}
}
<ng-container>
<span>
{{ model?.Content }}
</span>
<ng-content></ng-content>
</ng-container>
./list-box-item.component.scss