當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。