我自己写了一个filter 代码如下:
app.filter('selected', function() {
return function(input, value) {
var out = "";
if(input == value){
out = "selected";
}
return out;
};
});
页面代码如下:
<select class="form-control input-sm" style="width: 60px;">
<option {{data.page.pageSize|selected:5}} >5</option>
<option {{data.page.pageSize|selected:10}} >10</option>
<option {{data.page.pageSize|selected:20}} >20</option>
<option {{data.page.pageSize|selected:50}} >50</option>
</select>
但是现在这样写不起作用,pageSize是任何值的时候都没有效果。 哪位大神指教下谢谢了!
How about you stop using
filter
and change it like this?