Basically I'm trying to use this package pullToRefresh in my Angular application.
The code is as follows
const ptr = pullToRefresh.init({
mainElement: '.dashboard-container',
onRefresh() {
console.log('pulled');
// this._service.action();
}
});
now obviously the this is not going to work since this now refers to the onRefresh() callback function. So my question is how can I correctly bind this to use it correctly within that callback function onRefresh
now I have tried to just change the callback to an arrow function like so
onRefresh = () => {...
but my tslint says '=' can only be used in an object literal property inside a destructuring assignment.
any help would be appreciated