@bholub1 wrote:
My app relies on making calls to an OAuth2 server, so I have an @Injectable client that imports Http. Seems to work just fine and I'm able to make my authentication calls, but now I'm trying to add Storage (to save the oauth token data). I'm getting "No Provider for Storage!".
I found an article ( http://blog.thoughtram.io/angular/2015/09/17/resolve-service-dependencies-in-angular-2.html ) that seems maybe relevant, but I can't seem to get things working... I feel like I'm just overlooking some mundane detail. Here's a bit of what I think is relevant code
wac.ts (api client)
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; storage: Storage; constructor(http:Http, storage:Storage) { this.http = http; this.storage = new Storage(SqlStorage); } }
Thanks!
Posts: 7
Participants: 3