Use in directives and components to emit custom events synchronously or asynchronously, and register handlers for those events by subscribing to an instance.
Questions tagged [angular-event-emitter]
171 questions
1
vote
1 answer
Angular data passing child to parent not responding
I have a list of data in table from array and I am displaying form on the click on Add User button which is working fine.
But I also want to hide the form on click of cancel button which doesn't seem working. I followed the docs from angular…

Santosh
- 3,477
- 5
- 37
- 75
1
vote
1 answer
flash cards in angular - not listening to eventEmitter after component refresh
I inherited some code off someone and I'm having a weird problem with it and can't figure it out.
I have a screen that displays a grid of 9 flashcards - randomly selected - which should flip round and reveal a word when clicked (it's for teaching…

Andy Rox
- 13
- 3
1
vote
1 answer
Angular: how to force EventEmitter to flush in test
I have following Angular test:
it('should pass', fakeAsync(() => {
let a;
const eventEmitter1 = of('A');
eventEmitter1.subscribe(v => a = v);
let b;
const eventEmitter2 = new EventEmitter();
…

Felix
- 3,999
- 3
- 42
- 66
1
vote
2 answers
Interaction with a matSuffix mat-checkbox in a mat-form-field
I have an input in my mat-form-field that has a mat-checkbox in matSuffix.
INFO: The input will be constantly disabled.
TEST ...

Quentin
- 1,865
- 2
- 24
- 40
1
vote
1 answer
Angular directives - how to listen to outputs from child components
How can my customDirective listen to the clrDateChange output in the following example?

Han Che
- 8,239
- 19
- 70
- 116
1
vote
1 answer
Angular EventEmitter is not working in a callback
I have a somewhat odd issue with EventEmitter in a class. While I have some ideas to work around the problem, I would like to ask you if you have an idea to directly solve my issue.
Short summary
I have a parent and a child component. The parent…

andreas
- 7,844
- 9
- 51
- 72
1
vote
2 answers
How to disable custom event at library component?
There is a switcher component from ux-components library that allows several events to be processed. One of those event handlers is called onValueChange.
I want to prevent the default behavior and disable that event from triggering at all.
I tried…

tak tigry ne rychat
- 11
- 2
1
vote
1 answer
Angular 7 Unit test case for matdialog open method
I am getting static null injector error when I am trying to call dialogRef.componentInstance.onAdd method in spec file.
my code is below.
1. Viewer Component
import { Component, OnInit } from '@angular/core';
import { MatDialog } from…

Megha shah
- 232
- 3
- 13
1
vote
2 answers
Angular 6 - Child (Inner) Component emit an EventEmitter and wait to Parent Component return a respond
I have this component as a Parent component (facility.component), and I embedded a child/inner component (editableTable.component) inside this parent component, something like this
facility.component

MoeinMP
- 127
- 4
- 18
1
vote
0 answers
this.xxxx.emit is not a function
I'm having issues with errors regarding `@Output` and `@EventEmitter` in Angular7.
Code handling the click-event in the component:
import {…

Amine
- 11
- 3
1
vote
0 answers
Temporarily stop listening to an event emitter on a component
I have a common component [date-range-selector], in this component when the date values are changed it emits the new values as such
@Output() changeEvent = new EventEmitter();
//unimportant code
this.changeEvent.emit({ from: moment(from), to:…

Gavin Mannion
- 875
- 1
- 14
- 32
1
vote
6 answers
How to use a function of component1 in component2 in Angular 6 without interaction of HTML?
I have testTry() function in Component1 which accepts one parameter and prints the value.
export class Component1 implements OnInit {
testTry(name:any){
console.log("Name-->",name);}
ngOnInit(){ }
}
I have component2 with a function…

Sravya
- 65
- 13
1
vote
1 answer
Problems Sending Network Request Successfully after Event Emitter Notification in Angular App
In my Angular app I send out a network request to return some filtered data based on user-selected filters. This is working as expected. The function that takes in the filter values and makes the request looks like this:
public…

Muirik
- 6,049
- 7
- 58
- 116
1
vote
1 answer
Angular 5 - EventEmitter is sending data only once
I'm building a dashboard to manage users inside a company. That company has different numbers of departments and a bunch of filials inside those departments, so I have a custom recursive Tree View to display the association between those.
Now, when…

LuisMorais
- 162
- 4
- 16
1
vote
3 answers
Angual 6 event emitter - does not work
Can anyone please spot what is wrong in this code, I am not getting event back to appcomponent
test1.component.html

Mehul
- 25
- 6