akveo / akveo/ng2-smart-table

EventEmitter on customEditor components

Aperta
#583 3 commenti 4 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
1.6k
Fork
867
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I have a custom editor component

```
memberDOB: {
title: 'Date Of Birth',
type: 'html',
valuePrepareFunction: (cell, row) => { return this.datePipe.transform(row.memberDOB, 'dd/MM/yyyy'); },
editor: {
type: 'custom',
component: DatePickerComponent,
},
},
```
In the custom component, I am emitting an event

```
export class DatePickerComponent extends DefaultEditor implements AfterViewInit {

@Output() dateChange: EventEmitter = new EventEmitter();

constructor() {
super();
}

ngAfterViewInit() {}

onChange(event) {
this.dateChange.emit(event);
}
}
```
And then in the parent component html -

``

I have been trying to detect this event in the parent component but it is not working. On logging the DatePickerComponent in the log, it shows zero subscribers. How do I subscribe emitter from the custom child component in the parent?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.