【问题标题】:integrate formio api with my angular project将 formio api 与我的 Angular 项目集成
【发布时间】:2020-06-22 09:03:21
【问题描述】:
Source code 在 git 中
Live Demo
我想在我的 Angular 应用程序中开发 Angular8 拖放表单构建器功能
在上面的 git 代码中,它是使用纯 formio 开发的
我的要求是我想将这个角度拖放功能集成到我已经存在的角度项目中。
我很高兴集成formio,请帮助我如何进行集成。
有什么教程可以解释吗?
【问题讨论】:
标签:
angular
typescript
drag-and-drop
formio
angular-dragdrop
【解决方案1】:
首先你需要在你的项目中安装formio
npm install --save angular-formio
然后在你的项目模块中导入formioModule
import { FormioModule } from 'angular-formio';
@NgModule({
imports: [ BrowserModule, CommonModule, FormioModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
之后,如果您想使用 formio 构建表单,请在您的组件中调用 formio-builder,并通过调用 rest api 将表单 json 保存到数据库中。
<form-builder [form]="{
components: []
}"></form-builder>
如果您想在组件中显示表单,请使用 formion 渲染器
<formio src='https://examples.form.io/example'></formio>
如果您需要任何帮助,请告诉我。