Using Storage/SQLStorage in a provider

There’s no need to inject Storage, you should be able to just do this:

import {Injectable} from 'angular2/core';
import {Http, Headers, RequestOptions} from 'angular2/http';
import {Observable} from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import {Storage, SqlStorage} from 'ionic-framework/ionic';

@Injectable()
export class WAC {
    http: Http;
    
    constructor(http:Http) {
        this.http = http;
        this.storage = new Storage(SqlStorage, {name:'dbname'});
    }
}
1 Like