在 angular formio 中获取资源列表
Get resources list in angular formio
在使用这个 starter kit 时,我只能得到一个表单列表。
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FormioGrid } from 'angular-formio/grid';
import { FormManagerModule, FormManagerRoutes, FormManagerService, FormManagerConfig } from 'angular-formio/manager';
@NgModule({
imports: [
CommonModule,
FormioGrid,
FormManagerModule,
RouterModule.forChild(FormManagerRoutes())
],
declarations: [],
providers: [
FormManagerService,
{provide: FormManagerConfig, useValue: {
tag: 'common'
}}
]
})
export class FormModule { }
指向:
{api_url}/form?tags=common&type=form&limit=10&skip=0
我需要一种获取资源的方法,如下所示:
{api_url}/form?tags=common&type=resource&limit=10&skip=0
尝试将参数传递给提供商,但没有成功。
providers: [
FormManagerService,
{provide: FormManagerConfig, useValue: {
tag: 'common',
type: 'resource'
}}
]
我错过了什么?谢谢。
您可以从 query
属性 绑定 formio-grid
组件
传递 type
& tags
值
<formio-grid
...
[query]="{tags: 'common', type: 'resource'}"
...
>
</formio-grid>
在使用这个 starter kit 时,我只能得到一个表单列表。
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { FormioGrid } from 'angular-formio/grid';
import { FormManagerModule, FormManagerRoutes, FormManagerService, FormManagerConfig } from 'angular-formio/manager';
@NgModule({
imports: [
CommonModule,
FormioGrid,
FormManagerModule,
RouterModule.forChild(FormManagerRoutes())
],
declarations: [],
providers: [
FormManagerService,
{provide: FormManagerConfig, useValue: {
tag: 'common'
}}
]
})
export class FormModule { }
指向:
{api_url}/form?tags=common&type=form&limit=10&skip=0
我需要一种获取资源的方法,如下所示:
{api_url}/form?tags=common&type=resource&limit=10&skip=0
尝试将参数传递给提供商,但没有成功。
providers: [
FormManagerService,
{provide: FormManagerConfig, useValue: {
tag: 'common',
type: 'resource'
}}
]
我错过了什么?谢谢。
您可以从 query
属性 绑定 formio-grid
组件
type
& tags
值
<formio-grid
...
[query]="{tags: 'common', type: 'resource'}"
...
>
</formio-grid>