Skip to content

Instantly share code, notes, and snippets.

@b-tiwari
Last active January 24, 2018 20:30
Show Gist options
  • Select an option

  • Save b-tiwari/6b6150bffb20a51b3f940ab1b7a1dfb3 to your computer and use it in GitHub Desktop.

Select an option

Save b-tiwari/6b6150bffb20a51b3f940ab1b7a1dfb3 to your computer and use it in GitHub Desktop.
Ionic Events
import { Component } from '@angular/core';
import { Events } from 'ionic-angular';
import { AppEventsEnum } from '../Enums/AppEvents';
@Component({
selector: 'publisher',
templateUrl: 'publisher.html'
})
export class Publisher {
constructor(private event: Events) {}
publishArticle = () => {
let dataToPublish = { title: 'Small Coffee', author: 'John Doe'};
this.event.publish(AppEventsEnum.PublishArticle , dataToPublish);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment