Kurlrip
1/10/2017 - 10:28 AM

provider Database pour fonctionner avec PouchDB et couchDB

provider Database pour fonctionner avec PouchDB et couchDB

import { Injectable } from '@angular/core';
import { Http } from '@angular/http';
import 'rxjs/add/operator/map';
import PouchDB from 'pouchdb';


/*
  Generated class for the Database provider.

  See https://angular.io/docs/ts/latest/guide/dependency-injection.html
  for more info on providers and Angular 2 DI.
*/
@Injectable()
export class Database {

  data: any;
  db: any;
  remote: any;

  constructor(public http: Http) {
    console.log('Hello Database Provider');

    this.db = new PouchDB('cloudo');

    this.remote = 'http://91.121.254.35:15984/baseconsult';

    let options = {
      live: true,
      retry: true,
      continuous: true
    };

    this.db.sync(this.remote, options);

  }

  getDb() {

 }

 createDb(aData){

 }

 updateDb(aData){

 }

 deleteDb(aData){

 }

 handleChange(change){

 }

}