Oleg, I don't have IE. Try this code sample in IE and see if it works there https://stackblitz.com/edit/angular-56wcbh?file=app%2Fapp.component.html. The event is dispatched from the nested DeepComponent and bubbles up to the app component.
Regards Yakov On Tuesday, September 5, 2017 at 10:30:01 PM UTC-4, OlegKon wrote: > > > Sander, > > Thank you for your post. > Note: I have no plans using Angular Universal, so that is not a concern. > > I tried that elementRef.nativeElement.dispatchEvent(new CustomEvent()) > approach, it easily worked for me in Chrome, and I was happy. > > However, today I tried it with IE11, and got TS error like this Object is > not supported, > I guess, it is ElementRef is not supported in IE11? > Anyway, that is a showstopper for me (must support IE), > so back to the drawing board... > > Will try your second approach. > > TIA, > Oleg. > > > > On Wednesday, August 16, 2017 at 7:52:09 AM UTC-4, OlegKon wrote: >> >> Hi, >> >> >> My Angular2 app has many components, each of them communicates to backend >> to get data (error prone process), >> >> and then I need to show errors or warnings to the user in parent >> container (say, main page). >> >> Since bubbling doesn't seem to be supported in ng2/4 (why not?), is there >> easy way to pass info to parent container? >> >> >> I have seen some people suggesting to use >> elementRef.nativeElement.parentElement, >> >> some elementRef.nativeElement.dispatchEvent(new CustomEvent()).... >> >> Any better choices? >> >> >> Please advise. >> >> >> TIA, >> >> Oleg >> > -- 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.
