如何在AngularJs中将ng-repeat用于字典?

我知道我们可以轻松地对json对象或数组使用ng-repeat:


<div ng-repeat="user in users"></div>

但是如何将ng-repeat用于字典,例如:


var users = null;

users["182982"] = "{...json-object...}";

users["198784"] = "{...json-object...}";

users["119827"] = "{...json-object...}";

我想将其与用户字典一起使用:


<div ng-repeat="user in users"></div>

可能吗?。如果是,我该如何在AngularJs中做到这一点?


我的问题的示例:在C#中,我们定义如下字典:


Dictionary<key,value> dict = new Dictionary<key,value>();


//and then we can search for values, without knowing the keys

foreach(var val in dict.Values)

{

}

是否有内置函数可以像c#中那样从字典中返回值?


神不在的星期二
浏览 697回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

AngularJS