Skip to content

Newb Q: How do I know if the instance wasn't created before? #99

Description

@GianlucaBobbio

Im on Ionic, I need a DB to work on, with and without connection. My Q is, I need 2 instances of localForage, so how do I put in angular.run() that? I tried

if(!$localForage.instance('WorkOrders')){
        $localForage.createInstance({
            name: 'WorkOrders'
        });
    }

    if(!$localForage.instance('Inspections')){
        $localForage.createInstance({
            name: 'Inspections'
        });
    }

But it's not working (its first time so localForage.instance('Inspections') doesn't exist, but crush instead returning null)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions