【问题标题】:Select two sets of information using AngularJS select使用 AngularJS 选择两组信息 select
【发布时间】:2016-09-30 01:23:10
【问题描述】:

我需要使用 select 从我的数据库中获取两个选项。 我的 Firebase 中有以下信息:

 dias: "3"
 nome: "VISA - DEBITO"
 taxa: "1,11"
 tipo: "001"

我在 HTML 中使用这一行:

<div class="form-group">
    <label for="category" class="col-sm-3 control-label">Formas <span class="text-danger" style="font-size: 15px;">*</span></label>
    <div class="col-sm-9">
      <select chosen="{width: '100%'}" name="formas" class="form-control" id="formas" ng-options="item2.dias as item2.nome for item2 in childformas" ng-model="ordem.formaId" data-placeholder="Escolha a forma de pagamento">
          <option></option>
      </select>
    </div>
  </div>

这样做的结果是我将dias信息选择VISA - DEBITOordem.formaId -> 3,但我需要同时获取dias和taxa的信息。

有可能吗?

【问题讨论】:

  • 嗨!欢迎来到 StackOverflow。您可以使用 {} 按钮来格式化您的代码吗?

标签: javascript angularjs html firebase


【解决方案1】:

您应该查看有关指令的文档,然后您可以将 dias 和 taxa 分配给它们自己的自定义属性。

https://docs.angularjs.org/guide/directive

【讨论】:

  • 这是一个边界线link-only answer。您应该扩展您的答案以在此处包含尽可能多的信息,并仅使用该链接作为参考。始终引用重要链接中最相关的部分,以防目标站点无法访问或永久离线。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多