Last active
March 31, 2023 16:31
-
-
Save travist/e639060968a6ec984b38a49c3753043f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component, AfterViewInit, ViewChild } from '@angular/core'; | |
import { FormioComponent, Formio } from '@formio/angular'; | |
@Component({ | |
template: ` | |
<formio src="https://examples.form.io/example"></formio> | |
<button (click)="submitFormio()" class="btn btn-primary">Submit</button> | |
` | |
}) | |
export class FormRenderComponent implements AfterViewInit { | |
public formio: Formio; | |
@ViewChild(FormioComponent) formioComponent: FormioComponent; | |
ngAfterViewInit() { | |
this.formioComponent.formioReady.then((formio) => { | |
this.formio = formio; | |
}); | |
} | |
submitFormio() { | |
this.formio.submit().then(() => { | |
this.route.navigate(['...']); | |
}): | |
} | |
} |
I think it needs to be formioReady
. I have updated the example. Will you let me know if this works for you now?
it works now, maybe you know how to catch submersion of internal form via this construction?
@travist do we have formio.on(...) function here?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this.formioComponent.ready is not promise there