projects/ngx-list-view/src/lib/components/date-filter/ngx-date-filter.component.ts
| selector | ngx-date-filter |
| templateUrl | ngx-date-filter.component.html |
Properties |
|
Methods |
|
Inputs |
filterEmitter
|
Type: |
name
|
Type: |
title
|
Type: |
| Public changeValue | ||||||
changeValue(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| Public value |
value:
|
Type : string
|
Default value : ''
|
import {Component, Input, EventEmitter} from '@angular/core';
@Component({
selector: 'ngx-date-filter',
templateUrl: 'ngx-date-filter.component.html'
})
export class NgxDateFilterComponent {
@Input() public title: string;
@Input() public name: string;
public value = '';
@Input() public filterEmitter: EventEmitter<any>;
public changeValue(value: string) {
this.value = value;
this.filterEmitter.emit({
name: this.name,
value: value,
operator: '='
});
}
}
<label>{{title}}</label>
<input type="date"
class="form-control"
style="width:155px;display:inline-block"
[ngModel]="value"
(ngModelChange)="changeValue($event)"
/>