Skip to content

Instantly share code, notes, and snippets.

@travist
Created June 14, 2018 02:21
Show Gist options
  • Save travist/4d8ea88a1ea3683c24125b560be86c39 to your computer and use it in GitHub Desktop.
Save travist/4d8ea88a1ea3683c24125b560be86c39 to your computer and use it in GitHub Desktop.
Access Core renderer within Angular renderer
import { Component, AfterViewInit, ViewChild } from '@angular/core';
import { FormioComponent } from 'angular-formio';
@Component({
template: '<formio src="https://examples.form.io/example"></formio>'
})
export class FormRenderComponent implements AfterViewInit {
@ViewChild(FormioComponent) formioComponent: FormioComponent;
ngAfterViewInit() {
this.formioComponent.ready.then((formio) => {
// At this point, formio is the Core renderer and is an instance as you would see @ http://formio.github.io/formio.js/app/examples/hosted.html
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment