Sander,

Actually you were right from the beginning.
I tried again using your method #1.
After a few experiments I understood that it works (I had a bug, those 
events had to be processed in component definition, not in container),
so then it worked fine in both Chrome and IE11. (I haven't used Output much 
before...)
Here is a snippet of my code.

In my (child component):
@Output() errorMsg=new EventEmitter();
...
this.errorMsg.emit(msg);


Inside container HTML:
<myComponent  (errorMsg)="showError()" />

That's it, pretty simple.

I really appreciate your help!

Thank you,
Oleg


On Thursday, August 17, 2017 at 7:50:48 AM UTC-4, Sander Elias wrote:
>
> Hi Oleg,
>
> There are a lot of ways you can do this. There is even a 
> special documentation <https://angular.io/guide/component-interaction> 
> page about this subject.
>
>    1.  use an @Output, your parent can then listen for events submitted 
>    by your child component.
>    2. use an service. Put in a service that provides an event(like) 
>    system. you can then emit from your child, and listen in your main
>    3. inject the main component into the child-component, and call 
>    methods on it directly. 
>    4. what you said, but this is very error-prone
>    5. use localStorage as an event-bus
>    6. include a 3rth party event system
>
> I probably missed a a few ;)
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to