Angular js: Access data filtered in ng-repeat (ngRepeat) from controller

前端 未结 2 881
无人共我
无人共我 2020-12-31 23:54

I need to access data that was already filtered on a template (inside a ng-repeat) from my controller.

Here\'s what I mean:

I have this table in my template:

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-01 00:39

    You can simplify your code with the following:

        
            
                {{person.name}}
                {{person.gender}}
            
        
    

    After that, you can get access to $scope.filteredPersons into controller or {{filteredPersons}} right into the view :)

提交回复
热议问题