我知道我们可以轻松地对json对象或数组使用ng-repeat,如:
<div ng-repeat="user in users"></div>
Run Code Online (Sandbox Code Playgroud)
但是我们如何才能将ng-repeat用于词典,例如:
var users = null;
users["182982"] = "{...json-object...}";
users["198784"] = "{...json-object...}";
users["119827"] = "{...json-object...}";
Run Code Online (Sandbox Code Playgroud)
我想用用户词典:
<div ng-repeat="user in users"></div>
Run Code Online (Sandbox Code Playgroud)
可能吗?.如果是,我怎么能在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)
{
}
Run Code Online (Sandbox Code Playgroud)
是否有内置函数从c#中返回字典中的值?