以角度形式获取资源列表

时间:2018-10-02 19:40:50

标签: 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'
      }}
  ]

我缺少什么?谢谢。

1 个答案:

答案 0 :(得分:1)

您可以从type组件的tags属性绑定中传递queryformio-grid

<formio-grid
    ...
    [query]="{tags: 'common', type: 'resource'}"
    ...
>
</formio-grid>