Hi Ofer,

To call toggel, get a reference to the dom element your components is on, 
then call the event that calls your function. In your case it's probably 
something like:

let ev = new MouseEvent('click',options)
document.querySelector('main-app').dispatchEvent(ev)

To answer your second question, you don't. Making components accessible to 
the global scope is a terrible idea. (google for 'why is global scope 
considered bad). There is probably a technical way to do that, but just 
don't go there.

Regards
Sander

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" 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