【问题标题】:How to randomize data in ng-repeat in firebase如何在firebase中随机化ng-repeat中的数据
【发布时间】:2016-07-18 09:37:12
【问题描述】:

所以我有了一些想法,我想创建关于报价的 Firebase 数据,如下所示

quotes:{
    ObjectId:{
         title: "When there's a will there's a way"
       },
    ObjectId:{
         title: "When there's a will there's a way"
       }
}

我想要做的是,我想展示它但随机褪色。 如果我们使用 ng-repeat 它可能会显示所有这些。 关于我应该使用什么库的任何建议? 非常感谢您的帮助。

【问题讨论】:

标签: javascript angularjs firebase firebase-realtime-database


【解决方案1】:

您可以使用二维数组。用第一个数组的随机值填充 2ed 数组,并在 2ed 数组上使用绑定页面/ng-repeat :)

【讨论】:

  • 谢谢,知道我们如何每秒更改数据吗?
  • 在你的'Refresh'函数结束时,调用'setTimeout(Refresh, 1000)',这样你的'Refresh'函数就会每1秒被调用一次。
猜你喜欢
  • 2017-08-31
  • 1970-01-01
  • 2014-01-14
  • 1970-01-01
  • 1970-01-01
  • 2017-09-22
  • 2016-06-04
  • 1970-01-01
  • 2017-07-24
相关资源
最近更新 更多