Skip to content

How can i trigger a submitButton event in an Angular 8 application with angular elements? #434

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Schwofel opened this issue Jan 6, 2020 · 4 comments · Fixed by #443
Closed

Comments

@Schwofel
Copy link

Schwofel commented Jan 6, 2020

Hi @merobal,
@travist mentioned that you could possibly help me.
I want to trigger a submitButton Event (or any formio event for that matter) in a custom formio angular elements component. I know i could do this with a js component. But i would like to use angular elements.

Can you help me?

@merobal
Copy link
Collaborator

merobal commented Jan 6, 2020

Yes I also read #432
This will be a new feature, I will add it this week.

(I need to connect the Angular scope with the formio class behind it via an Output. I keep you posted.)

@Schwofel
Copy link
Author

Schwofel commented Jan 6, 2020

Thank you very much.

@ajaykumarsana
Copy link

ajaykumarsana commented Apr 14, 2022

@merobal
I'm having an issue here when i emit custom event from custom component like below.
this.formioEvent.emit({ eventName: 'viewer', data: { url: 'assets/docs/a.pdf' } });

this event is not getting catch in CustomEvent method
<formio [form]='formSrc' [submission]='model' [options]='options' (customEvent)="customEvent($event)" ></formio>

Please help.
Thanks a Lot.

@travist
Copy link
Member

travist commented Apr 27, 2022

You would emit a custom event by first getting the Form.io renderer instance from the Angular controller like so.

https://gist.github.com/travist/e639060968a6ec984b38a49c3753043f

Then, you can do the following in the callback.

formio.emit('submitButton');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants