Hi there,
has anyone managed to successfully emit an event from a tabbed view?
I keep getting this error:
Uncaught ReferenceError: notificationEvents is not defined
when trying to emit an event from one of my views after an ajax request.
the code in the success part of the ajax request is as follows:
notificationEvents.emit(‘notificationReceived’, {
zone: ‘#mainToolbar’,
type: ‘.watching’,
count: data.fav_count,
});
and in my app.js
const notificationEvents = new Framework7.Events();
notificationEvents.on(‘notificationReceived’, function (notification) {
$$(notification.zone).find(notification.type).append(’’+notification.count+’’);
});
I can emit events from within the app.js but I would like to from any view in my app.
thanks in advance