问题
Here is my code : Jsfiddle
Initialy its should display all the data.
I'm able to add new
tagsand based ontagselection data is filtering but data should be added below the existing filtered data if newtagis selected and data should be removed iftagis deleted.
回答1:
finally
Everythingis resolved.
//FILTER
.filter('findobj', function () {
return function (dataobj, multipleVlaue) {
if (!multipleVlaue) return dataobj;
return dataobj.filter(function (news) {
var tofilter = [];
angular.forEach(multipleVlaue,function(v,i){
tofilter.push(v);
});
return news.CategoryList.some(function (category) {
return tofilter.indexOf(category.DisplayName)>-1;
});
});
};
})
Here u can refer : CODE
来源:https://stackoverflow.com/questions/31655104/angularjs-filtering-data-based-on-option-selection-and-tag-creation-based-on-sel