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


TypeScript lodash.findWhere函数代码示例

本文整理汇总了TypeScript中lodash.findWhere函数的典型用法代码示例。如果您正苦于以下问题:TypeScript findWhere函数的具体用法?TypeScript findWhere怎么用?TypeScript findWhere使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了findWhere函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

    return this.backendSrv.get(`/api/plugins/${this.pluginId}/settings`).then(result => {
      this.model = result;
      this.pluginIcon = this.getPluginIcon(this.model.type);

      this.model.dependencies.plugins.forEach(plug => {
        plug.icon = this.getPluginIcon(plug.type);
      });

      this.includes = _.map(result.includes, plug => {
        plug.icon = this.getPluginIcon(plug.type);
        return plug;
      });

      if (this.model.type === 'app') {
        this.tabIndex = 1;
        this.tabs.push('Config');

        this.hasDashboards = _.findWhere(result.includes, {type: 'dashboard'});
        if (this.hasDashboards) {
          this.tabs.push('Dashboards');
        }
      }

      return this.initReadme();
    });
开发者ID:ColonelHou,项目名称:grafana,代码行数:25,代码来源:plugin_edit_ctrl.ts

示例2: it

 it('should add datasource to required', function() {
   var require = _.findWhere(exported.__requires, {name: 'TestDB'});
   expect(require.name).to.be("TestDB");
   expect(require.id).to.be("testdb");
   expect(require.type).to.be("datasource");
   expect(require.version).to.be("1.2.1");
 });
开发者ID:21hub,项目名称:grafana,代码行数:7,代码来源:exporter_specs.ts

示例3: repeatRow

  // returns a new row clone or reuses a clone from previous iteration
  repeatRow(row, rowIndex) {
    var variables = this.dashboard.templating.list;
    var variable = _.findWhere(variables, {name: row.repeat});
    if (!variable) {
      return;
    }

    var selected, copy, i, panel;
    if (variable.current.text === 'All') {
      selected = variable.options.slice(1, variable.options.length);
    } else {
      selected = _.filter(variable.options, {selected: true});
    }

    _.each(selected, (option, index) => {
      copy = this.getRowClone(row, index, rowIndex);
      copy.scopedVars = {};
      copy.scopedVars[variable.name] = option;

      for (i = 0; i < copy.panels.length; i++) {
        panel = copy.panels[i];
        panel.scopedVars = {};
        panel.scopedVars[variable.name] = option;
        panel.repeatIteration = this.iteration;
      }
    });
  }
开发者ID:Robin7Ma,项目名称:grafana,代码行数:28,代码来源:dynamic_dashboard_srv.ts

示例4: datasourceChanged

 datasourceChanged() {
   var ds = _.findWhere(this.datasources, {name: this.dsSegment.value});
   if (ds) {
     this.current = ds;
     this.panelCtrl.setDatasource(ds);
   }
 }
开发者ID:0x01feng,项目名称:grafana,代码行数:7,代码来源:metrics_ds_selector.ts

示例5:

    return this.panelCtrl.getDashboardOptions().then(options => {
      if (!this.target) { return; }
      var option = _.findWhere(options, {value: this.target.dashboard});

      if (!option) { return; }
      this.targetName = option.name;
    });
开发者ID:mark-5,项目名称:grafana-kpi-panel,代码行数:7,代码来源:query.ts

示例6:

 this.backendSrv.get(`/api/org/plugins/${this.pluginId}/settings`).then(app => {
   this.appModel = app;
   this.page = _.findWhere(app.pages, {slug: this.$routeParams.slug});
   if (!this.page) {
     $rootScope.appEvent('alert-error', ['App Page Not Found', '']);
   }
 });
开发者ID:HimanshPal,项目名称:grafana,代码行数:7,代码来源:page_ctrl.ts

示例7: function

 .add<UpdateToolSlotPayl>("UPDATE_SLOT", function (s, a) {
     let { slot_id, property, value } = a.payload;
     let slot = _.findWhere(s.tool_slots, { id: parseInt(slot_id) });
     /** ??? TODO: Tried changing interfaces but can't seem to please TS */
     (slot as any)[property] = parseInt(value);
     return s;
 })
开发者ID:roryaronson,项目名称:farmbot-web-frontend,代码行数:7,代码来源:reducer.ts

示例8: function

 $scope.koulutusalaMuuttui = function() {
     $scope.hakuparametrit.opintoala = "";
     if ($scope.hakuparametrit.koulutusala !== "") {
         $scope.opintoalat = (_.findWhere($scope.koulutusalat, {
             koodi: $scope.hakuparametrit.koulutusala
         }) as any).opintoalat;
     } else {
         $scope.opintoalat = [];
     }
     $scope.hakuMuuttui();
 };
开发者ID:Opetushallitus,项目名称:eperusteet,代码行数:11,代码来源:haku.ts


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