title: AngularJS Filter in MattLewis Angular Bootstrap Calendar
body: <p>I want to achieve a searching for event inside the MattLewis Angular Bootstrap Calendar from this <a href="https://github.com/mattlewis92/angular-bootstrap-calendar" rel="nofollow noreferrer">https://github.com/mattlewis92/angular-bootstrap-calendar</a></p>
  
  <p>I already set up everything, the filters work but it just give me a bunch of error that causes my other functions did't work well.</p>
  
  <p>Here is code for calendar</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;mwl-calendar events="events | filter:{title:listView}"
                                view="calendarView"
                                view-title="calendarTitle"
                                view-date="date"
                                on-event-click="eventClicked(calendarEvent)"
                                on-event-times-changed="eventTimesChanged(calendarEvent); calendarEvent.startsAt = calendarNewEventStart; calendarEvent.endsAt = calendarNewEventEnd"
                                edit-event-html="'&lt;i class=\'glyphicon glyphicon-pencil\'&gt;&lt;/i&gt;'"
                                delete-event-html="'&lt;i class=\'glyphicon glyphicon-remove\'&gt;&lt;/i&gt;'"
                                on-edit-event-click="eventEdited(calendarEvent)"
                                on-delete-event-click="eventDeleted(calendarEvent)"
                                cell-is-open="isCellOpen"
                                day-view-start="06:00"
                                day-view-end="22:00"
                                day-view-split="30"
                                cell-modifier="modifyCell(calendarCell)"
                                on-view-change-click="false"&gt;
                  &lt;/mwl-calendar&gt;
  </code></pre>
  
  <p><strong>Controller</strong></p>
  
  <pre><code>$scope.events = [
             {
                 title: 'An event',
                 type: 'warning',
                 startsAt: moment().startOf('week').subtract(2, 'days').add(8, 'hours').toDate(),
                 endsAt: moment().startOf('week').add(1, 'week').add(9, 'hours').toDate(),
                 draggable: true,
                 resizable: true
             }, {
                 title: '&lt;i class="glyphicon glyphicon-asterisk"&gt;&lt;/i&gt; &lt;span class="text-primary"&gt;Another event&lt;/span&gt;, with a &lt;i&gt;html&lt;/i&gt; title',
                 type: 'info',
                 startsAt: moment().subtract(1, 'day').toDate(),
                 endsAt: moment().add(5, 'days').toDate(),
                 draggable: true,
                 resizable: true
             }, {
                 title: 'This is a really long event title that occurs on every year',
                 type: 'important',
                 startsAt: moment().startOf('day').add(7, 'hours').toDate(),
                 endsAt: moment().startOf('day').add(19, 'hours').toDate(),
                 recursOn: 'year',
                 draggable: true,
                 resizable: true
             }
          ];
  </code></pre>
  
  <p>this is the filter i've tried</p>
  
  <pre><code>events="events | filter:{title:listView}
  </code></pre>
  
  <p>but sad to say it just give me a bunch of errors</p>
  
  <p>Here is the error
  <a href="https://i.stack.imgur.com/TIWtC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TIWtC.png" alt="enter image description here"></a></p>
  
  <p>is there any other solution to what i want to achieve. I tried custome filters like this</p>
  
  <pre><code>app.filter('searching', function() {
      return function(items, word) {
          var filtered = [];
  
          angular.forEach(items, function(item) {
              if(item.indexOf(word) !== -1){
                  filtered.push(item);
              }
          });
          return filtered;
      };
  });
  </code></pre>
  
  <p>but did't work too. The error is in <code>indexOf</code> not recognize as function</p>