0

我有一个ng-repeat这样定义:

{"ng-repeat" => "city in cities() | filter: search"}

一个城市是{ attributes: {name: 'Boston'} }

像这样的形式:

%input{:type => "search", "ng-model" => "search.attributes.name"}

但它不起作用,我该如何过滤city.attributes.name

4

1 回答 1

1

您的过滤条件应如下所示:

city in cities() | filter: {attributes: {name: search}}

然后将您的模型设置为搜索值:

%input{:type => "search", "ng-model" => "search"}

于 2013-07-18T15:35:26.653 回答