I want to achieve a searching for event inside the MattLewis Angular Bootstrap Calendar from this https://github.com/mattlewis92/angular-bootstrap-calendar
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.
Here is code for calendar
HTML
<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="'<i class='glyphicon glyphicon-pencil'></i>'"
delete-event-html="'<i class='glyphicon glyphicon-remove'></i>'"
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">
</mwl-calendar>
Controller
$scope.events = [
{
title: 'An event',
type: 'waing',
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: '<i class="glyphicon glyphicon-asterisk"></i> <span class="text-primary">Another event</span>, with a <i>html</i> 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
}
];
this is the filter i've tried
events="events | filter:{title:listView}
but sad to say it just give me a bunch of errors
is there any other solution to what i want to achieve. I tried custome filters like this
app.filter('searching', function() {
retu function(items, word) {
var filtered = [];
angular.forEach(items, function(item) {
if(item.indexOf(word) !== -1){
filtered.push(item);
}
});
retu filtered;
};
});
but did't work too. The error is in indexOf not recognize as function

