当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript service.DataFormService.getTaxonomyLR方法代码示例

本文整理汇总了TypeScript中@geonature_common/form/data-form.service.DataFormService.getTaxonomyLR方法的典型用法代码示例。如果您正苦于以下问题:TypeScript service.DataFormService.getTaxonomyLR方法的具体用法?TypeScript service.DataFormService.getTaxonomyLR怎么用?TypeScript service.DataFormService.getTaxonomyLR使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在@geonature_common/form/data-form.service.DataFormService的用法示例。


在下文中一共展示了service.DataFormService.getTaxonomyLR方法的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;
    });
  }
开发者ID:PnEcrins,项目名称:GeoNature,代码行数:59,代码来源:taxon-advanced-store.service.ts


注:本文中的@geonature_common/form/data-form.service.DataFormService.getTaxonomyLR方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。