本文整理汇总了TypeScript中@geonature_common/form/data-form.service.DataFormService.getTaxhubBibAttributes方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.DataFormService.getTaxhubBibAttributes方法的具体用法?TypeScript service.DataFormService.getTaxhubBibAttributes怎么用?TypeScript service.DataFormService.getTaxhubBibAttributes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@geonature_common/form/data-form.service.DataFormService
的用法示例。
在下文中一共展示了service.DataFormService.getTaxhubBibAttributes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(
private _dataService: DataFormService,
private _syntheseDateService: DataService,
private _formService: SyntheseFormService,
private _formGen: DynamicFormService
) {
if (AppConfig.SYNTHESE.DISPLAY_TAXON_TREE) {
this._syntheseDateService.getTaxonTree().subscribe(data => {
this.taxonTree = this.formatTaxonTree(data);
});
}
// get taxhub attributes
this._dataService.getTaxhubBibAttributes().subscribe(attrs => {
// display only the taxhub attributes set in the config
this.taxhubAttributes = attrs
.filter(attr => {
return AppConfig.SYNTHESE.ID_ATTRIBUT_TAXHUB.indexOf(attr.id_attribut) !== -1;
})
.map(attr => {
// format attributes to fit with the GeoNature dynamicFormComponent
attr['values'] = JSON.parse(attr['liste_valeur_attribut']).values;
attr['attribut_name'] = 'taxhub_attribut_' + attr['id_attribut'];
attr['required'] = attr['obligatoire'];
attr['attribut_label'] = attr['label_attribut'];
if (attr['type_widget'] == 'multiselect') {
attr['values'] = attr['values'].map(val => {
return { value: val };
});
}
this._formGen.addNewControl(attr, this._formService.searchForm);
return attr;
});
this.formBuilded = true;
});
// load LR, habitat and group2inpn
this._dataService.getTaxonomyLR().subscribe(data => {
this.taxonomyLR = data;
});
this._dataService.getTaxonomyHabitat().subscribe(data => {
this.taxonomyHab = data;
});
const all_groups = [];
this._dataService.getRegneAndGroup2Inpn().subscribe(data => {
this.taxonomyGroup2Inpn = data;
// tslint:disable-next-line:forin
for (let regne in data) {
data[regne].forEach(group => {
if (group.length > 0) {
all_groups.push({ value: group });
}
});
}
this.taxonomyGroup2Inpn = all_groups;
});
}