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

module globalEvent #33

Open
angelozhou opened this issue Sep 16, 2017 · 2 comments
Open

module globalEvent #33

angelozhou opened this issue Sep 16, 2017 · 2 comments

Comments

@angelozhou
Copy link

const globalEvent = weex.requireModule('globalEvent')

export default {
onCollectEvent() {
return new Promise((resolve) => {
globalEvent.addEventListener('collectEvent', event => {
console.log('get geolocation', event)
resolve()
})
})
}
}

调用这个方法提示 cannot read property 'addEventListener' of undefined, globalEvent 这个变量是udnefined

@walid1992
Copy link
Owner

我升级了下sdk,也看一下官方文档

@angelozhou
Copy link
Author

所以现在是可以用了吗?

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

No branches or pull requests

2 participants