Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Make it so that users do not need to know about the "deviceready" event. #1090

Open
wants to merge 1 commit into
base: dev-next
Choose a base branch
from

Conversation

dts
Copy link

@dts dts commented Dec 8, 2015

I think it's unnecessary to require end users to care about the internal workings of cordova and cordova plugins - the point of this library is to insulate users from those implementation details. I have added a deviceReady provider that allows plugins to wait for the device to be ready before operating, making it so that users just do the most simple thing. I've modified the geolocation service provider to use this technique, mostly as an example. Ideally, all of the plugins would be converted, but I don't want to do that before I've gotten some more feedback. We could optimize the deviceReady provider somewhat, but the way it is here will/does work.

This is mainly a PR because I wanted to illustrate what I was talking about with actual code. If there is a positive response to it and/or feedback, I can roll out a more by-the-books and fully-baked version.

@robertarnesson
Copy link

I've created a full version of ngCordova that does just that - https://github.com/arnesson/angular-cordova

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

Successfully merging this pull request may close these issues.

2 participants