You can use this trick:
<div ng-init="filteredItems = all_data"/>
<input ng-model="searchText" ng-change="filteredItems = (all_data | filter: searchText)">
At start, filteredItems
equals all_data
. When input searchText
changed, filteredItems
changed too.
You can use {{filteredItems}}
on the view, and $scope.filteredItems
in the controller.
I adjust your plunker, please see it.