Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 以角格式获取资源列表_Angular_Formio - Fatal编程技术网

Angular 以角格式获取资源列表

Angular 以角格式获取资源列表,angular,formio,Angular,Formio,当使用这个时,我只能得到一个表单列表 import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { RouterModule } from '@angular/router'; import { FormioGrid } from 'angular-formio/grid'; import { FormManagerModule, FormManagerRout

当使用这个时,我只能得到一个表单列表

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'
      }}
  ]

我错过了什么?谢谢。

您可以通过
查询
formio grid
组件的
属性绑定传递
类型
标记

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


谢谢,但对不起,我不明白。这是哪个文件?在formio组件上使用它,你能在使用formio的地方添加html代码吗?我不确定。我在这里看不到任何风景。所有东西都在node_模块内。我(几乎)唯一的文件是src/app/form/form.module.ts和form.module.spec.ts(带有我上面发布的代码)。@PankajParkar是正确的。下面是用于表单的代码。您只需要做同样的事情,但是使用类型的资源。谢谢你,潘卡吉,现在我明白了。标记为已回答。谢谢特拉维斯为我们提供了这么好的平台。