本文整理匯總了TypeScript中@geonature_common/form/data-form.service.DataFormService.getTaxonomyHabitat方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.DataFormService.getTaxonomyHabitat方法的具體用法?TypeScript service.DataFormService.getTaxonomyHabitat怎麽用?TypeScript service.DataFormService.getTaxonomyHabitat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@geonature_common/form/data-form.service.DataFormService
的用法示例。
在下文中一共展示了service.DataFormService.getTaxonomyHabitat方法的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;
});
}