Get angular component for given HTML element in production

Viewed 38

Is it possible to obtain the angular component instance from a given HTML element (representing an angular component) in production without passing it through @Output?

E.g.

const el = document.querySelector('...')!;
const elComponent = somehowGetComponentInstanceFor(el);

ng.getComponent should not work for production builds according to https://angular.io/api/core/global:

[...] These functions are not exposed when the application runs in a production mode.

(I can't use @ViewChild and i don't want to introduce a long @Output-chain.)

0 Answers
Related