filter list of items when clicking category link

前端 未结 2 1589
甜味超标
甜味超标 2020-12-13 07:30

I have a list of items with \"ng-repeat\". Each item contains a div with a link title and link category. When clicking on a category, I want to filter the list of items, so

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-13 07:59

    angular.module('app',[])
      .controller('MainController', function($scope) { 
      $scope.team =[
        {cat_id:1,team: 'alpha'},
        {cat_id:2,team: 'beta'},
        {cat_id:3,team: 'gamma'}
                   ];
      
        $scope.players = [
          {name: 'Gene',cat_id : 1},
          {name: 'George',cat_id : 2},
          {name: 'Steve',cat_id : 3},
          {name: 'Pzula',cat_id : 2},
          {name: 'shrikant',cat_id : 3}
        ];
     });
    
    
      {{value.team}}
    • {{ p.name }}

提交回复
热议问题