是否可以将Angular UI-Bootstrap Typeahead与以下数据一起使用?此数据表示wordpress分类,格式为term_id:term_name
$scope.domainFields = {
"304": "Administration et secr\u00e9tariat",
"305": "Arts, m\u00e9dias et divertissement",
"306": "Assurance",
"307": "Comptabilit\u00e9 et finance"
//...
};
查看:
我正在使用Angular-xeditable typeahead,它实现了Angular-ui typeahead。
currentUser.field包含当前的term_id,如何在e-typeahead中循环遍历domainFields对象并显示与term_id关联的当前term_name?
<a href="#"
editable-text="currentUser.field"
e-typeahead="
term_id as term_name for field in domainFields
| filter:$viewValue
| limitTo:8">
{{ domainFields[currentUser.field] || 'empty' }}
</a>
答案 0 :(得分:0)
在e-typeahead
<强>标记强>
<a href="#"
editable-text="currentUser.field"
e-typeahead="
term_id as term_name for (term_id, term_name) in domainFields
| filter:$viewValue
| limitTo:8">
{{ domainFields[currentUser.field] || 'empty' }}
</a>