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是正确的。下面是用于表单的代码。您只需要做同样的事情,但是使用类型的资源。谢谢你,潘卡吉,现在我明白了。标记为已回答。谢谢特拉维斯为我们提供了这么好的平台。