Reloading ion-list based on search input text - causing crash

Hi all, I’m new to Ionic/Cordova/Angular etc so I’m hoping someone with more experience can quickly point out what I’m doing wrong.

I’ve created a conference type app using the ionic tab template. On one of my tabs I display a list of conference attendees. I would like to be able to search the list and display the results that match the search input text.

The code I have is currently working on my iPhone emulator(s) and is also working fine when I run the app in a browser. However, if I push the app to my physical iOS device my app is crashing occasionally when I type in the input field.

Here are my code snippets.

1. My ion-view

        <ion-item class="item-remove-animate item-avatar item-icon-right" ng-repeat="attendee in attendees" type="item-text-wrap" href="#/tab/attendees/{{}}">
            <img ng-src="{{attendee.face}}">
            <i class="icon ion-chevron-right icon-accessory"></i>

2. My Controller
.controller(‘AttendeesCtrl’, function($scope, Attendees) {
$scope.attendees = Attendees.all();

$ = function(searchString){
if(searchString == null || searchString == “”){
$scope.attendees = Attendees.all();
//$scope.attendees = [];
var tempList = [];
var attendeeList = Attendees.all();
var len = attendeeList.length;
var item;
for (var i=0; i<len; i++) {
item = attendeeList[i];

          if ( > -1) {
      $scope.attendees = tempList;



Thanks for any possible help in advance!

here is the codePen -