ここでサンプルアプリを作成します。私のアプリには、スコープ内に と という名前のオブジェクトの 2 つの配列がありdata
ますdata2
。また、私は2つのディレクティブを持っています:
app.directive('root',function(){
return {
scope:{
items:'='
},
restrict:'AE',
template:'<ul><li>Item<ul><li ng-repeat="item in items"><show-item mo="item"></show-item>l</li></ul></li></ul>'
};
});
app.directive('showItem',function(){
return {
restrict:'EA',
scope:{
mo:'='
},
controller:function(){
},
template:'<span>{{mo.name}}</span>'
};
});
モデルで名前で検索するための入力検索が1つあります。しかし、これら2つのモデルを1つの入力で同じクエリで検索するにはどうすればよいですか