I am using events to subscribe an event in my ionic 3 application. It seems there are two ways to unsubscribe the subscription as given in the unsubscription1() and unsubscription2()
Could you please tell what is the difference of these two methods? are both of them can unsubscribe the subscription as expected?
import { Events } from 'ionic-angular'; ... messageSubscription: any constructor(private events: Events ...){ ... } subscription(){ messageSubscription = this.events.subscription("newmessage", () => { ... } } unsubscription1(){ this.events.unsubscription("newmessage") } unsubscription2(){ messageSubscription.unsubscribe() }