Questions tagged eventemitter

Explore the latest questions and answers asked by our top developers.

why am i getting error with angular EventEmitter code

i am learning from a video and this code seems to work for him not me. can someone explain plz why am i getting error in onPostAdded(post) post variable is of type any app.component.html <app-header></app-header> <main> <app-post-create (postCreated)="onPostAdded($event)"></app-post-create> <app-post-list [posts]="storedPosts"></app-post-list> </main> <router-outlet></router-outlet> app.component.ts import { Component } from ‘@angular/core’; @Component({ selector: ‘app-root’, templateUrl: ‘./app.component.html’, styleUrls: […]

By Ak Ash
Published
Categorized as angular, eventemitter, node.js Tagged , ,

unable to Access the event object with the $event argument passed to the output event handler

Trying to perform pagination .I am able to fetch data in console but unable to show it in html. I guess problem is in (responseData)="posts3 =($event)" in test.component.html. I think event Emmiter is not working. i have also tried doing (responseData)="posts3 ($event)" it doesnt work pagination.component.ts import { Component, OnInit } from ‘@angular/core’; import { […]

How to Implement Metamask EventEmitter to Angular?

In Metamask Provider, there is an EventEmitter like this ethereum.on(‘accountsChange’, (accounts) => console.log(accounts)) How to implement this to angular component? When I try to put this in component constructor like this @Component({ selector: ‘app-root’, templateUrl: ‘./app.component.html’, styleUrls: [‘./app.component.css’] }) export class AppComponent { currentAccount: string; constructor() { ethereum.on(‘accountsChange’, (accounts) => { console.log(accounts); this.currentAccount = accounts[0]; […]

By fahadh4ilyas
Published
Categorized as angular, ethereum, eventemitter, metamask Tagged , , ,

Angular event not triggered second time

I have a question. Why the second time I press click on parent component the event is not triggered? for example I have first component for parent <app-page> <div *ngFor="let object of objects$ | ngrxPush"> <app-parent> <div class="add-button"> <button (click)="onAddBtnClick(object)" mat-icon-button > </button> </div> </app-parent> <app-child-container [viewChildContainer]="object.showChildContiner" (containerClickOutside)="onContainerClick(object)" > </app-child-container> </div> </app-page> In .ts file […]

By DaVinci005
Published
Categorized as angular, click, components, eventemitter Tagged , , ,

Parent Component not picking up change in EventEmitter value in Child Component

I am running into an issue where the child component emits different values as the application is loading, however the parent is not picking up the latest value — I have a parent component whose table rows are children components — this parent component gets data from another web component in the application called List-Selection, […]

EventEmitter cannot emit an object with KeyValuePair property in Angular

I want to fill and emit an object that has 2 property; 1. string 2.array of KeyValuePair by EventEmitter in Angular version 9. My object’s class: import { KeyValuePair } from ‘./keyValuePair’; export class SelectedApiCall { public identifier: string; public predefinedParameters: Array<KeyValuePair<string, string>> | undefined; constructor(identifier: string, predefinedParameters: Array<KeyValuePair<string, string>>) { this.identifier = identifier; this.predefinedParameters […]

Angular 12: Listening to multiple children events in Parent component

I’m a beginner to Angular when It comes to events and such. Lately I’ve been working on this project where I have a parent Component called Layout, which contains multiple child components that are supposed to do CRUD operations through various services. Now the Layout component has a navbar and this navbar shows the number […]

data only displaying after refresh in angular

I’ve card component, Home Page and Explore page. I have show all the cards in Explore page and user have the ability to favorite a particular card and it’ll display in the Homepage. the problem I have right now is the favorited cards only appear in Homepage when I refresh the browser, It didn’t show […]

By Aase Zi
Published
Categorized as angular, emit, eventemitter, html, typescript Tagged , , , ,

Output and EventEmtiter not sending any data?

I want to send data from my child component to my parent component using the Output() and EventEmitter methods. However, it appears as though nothing is being sent through, despite the function the emitter is in being hit in the child component? My child component: @Output() urlStringEvent = new EventEmitter<string>(); ngOnInit(): void { this.startUpload(); } […]

By SeventhWarhawk
Published
Categorized as angular, eventemitter, output, typescript Tagged , , ,

Angular Parent Component with Tow Child Component can’t shared data

I have a Angular Parent Component with tox Child Component. I want to share a variable between the two child and I configure this : Parent TypeScript @Component({ selector: ‘jhi-saison-dashboard’, templateUrl: ‘./saison-dashboard.component.html’, }) export class SaisonDashboardComponent { saisonSelectionnee?: ISaison; evenementDeTopheader(saisonRetourneeParTopHeader: ISaison): void{ this.saisonSelectionnee = saisonRetourneeParTopHeader; } evenementDeOption(saisonRetourneeParOption: ISaison): void{ this.saisonSelectionnee = saisonRetourneeParOption; } } HTML […]

By Broshet
Published
Categorized as angular, eventemitter, typescript Tagged , ,
1 4

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq