Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use this plugin in Ionic2? #9

Closed
Coder7777 opened this issue Dec 20, 2016 · 5 comments
Closed

how to use this plugin in Ionic2? #9

Coder7777 opened this issue Dec 20, 2016 · 5 comments

Comments

@Coder7777
Copy link

very less doc to descript how to use cordova broadcaster in Ionic2?
Could please offer a full demo?

@mebibou
Copy link

mebibou commented Jan 16, 2017

Same way you would use it in ionic 1

@bsorrentino
Copy link
Owner

bsorrentino commented Jan 16, 2017

Hi

I don't use Ionic 1/2 for app development, so I haven't tech details about what you are asking

I don't think that, for using such plugin in ionic, there are particular issues ... however if you gather Help & HowTo related it, please share with me

@mebibou
Copy link

mebibou commented Jan 16, 2017

So basically you can do:

ionic plugin add add cordova-plugin-broadcaster

Then in your code just use the JS samples as provided, like window.broadcaster.addEventListener('eventName', event => console.log(event));.
If typescript complains about broadcaster not defined on Windows, just declare the interface like:

interface Windows {
  broadcaster: any;
}

FYI, I submitted a PR to add the Broadcaster support in ionic native

@bsorrentino
Copy link
Owner

bsorrentino commented Jan 16, 2017

Looks great ... I'll watch the progress

@bsorrentino
Copy link
Owner

such plugin has been added to ionic-native distribution How to is available here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants