2

I have a scenario that I have an event called AdviceEvent registered by two different components ParentCmp and FriendCmp. And Third component called PersonCmp is handling both event.

The Question is if both ParentCmp and FriendCmp fire the same event at same time. at that situation PersonCmp should only listen to ParentCmp's event.

And how can we identify from which component that event has been fired?

Thanks in advance :)

0

One way is to use a string attribute in the event and set its value fired from ParentCmp when firing from ParentCmp and fired from FriendCmp when fired from FriendCmp and in the listener object you can check the string value to know where is it fired from.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.