Reputation: 113
How can I add PouchDB to an Angular 5 or 6 project? I am using Angular 6 and I could not find any way to do that.
Upvotes: 4
Views: 5882
Reputation: 222722
Yes you can use PouchDB with angular with this library
import PouchDB from 'pouchdb';
Here is a sample Poucdhb with angular
project i came across.
You can use it as follows,
private db: any;
private isInstantiated: boolean;
private listener: EventEmitter<any> = new EventEmitter();
public constructor() {
if (!this.isInstantiated) {
this.db = new PouchDB('locosporalva');
this.isInstantiated = true;
}
}
Upvotes: 5