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

Can you add this little bit of code so this works outside of ionic? #6

Open
jeffthompson1971 opened this issue Apr 9, 2016 · 1 comment

Comments

@jeffthompson1971
Copy link

I really don't want to make local changes to your code.. i'm including your repo as a sub-module for my own bower component/repo. This works as is perfectly in ionic on both just browsers as well as on apps, but i wanted to re-use my components on a web-app that is not ionic. when i tried it crashes cuz 'ionic' is not defined. All i had to do was wrap it in a try-catch block and now it work in and outside of ionic:

try {
if(ionic.Platform.isIOS()){
//Force WebSQL on IOS as IndexedDB is not stable on IOS
var iosConfig = angular.extend(IMAGENIE_LOCAL_FORAGE_CONFIG, {driver : 'webSQLStorage'});
imagenieLocalForageInstance = $localForage.createInstance(iosConfig);
}else{
imagenieLocalForageInstance = $localForage.createInstance(IMAGENIE_LOCAL_FORAGE_CONFIG);
}
} catch (error) {
imagenieLocalForageInstance = $localForage.createInstance(IMAGENIE_LOCAL_FORAGE_CONFIG);
}

Can i talk you into making this patch?

@saniyusuf
Copy link
Owner

saniyusuf commented Apr 10, 2016

@jeffthompson1971 This is interesting. If I am correct you want to make use of this component in a non-Ionic environment correct?

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