shindesharad71 / Ionic-Firebase-Shopping-List

A Shopping List Hybrid Mobile Application For Understanding Concepts of Ionic 3 and Firebase.
0 stars 0 forks source link

Beep Chat Application #2

Closed parveen-chhillar closed 6 years ago

parveen-chhillar commented 6 years ago

this is my data.service.ts file in provider

================== import { Injectable } from '@angular/core'; import { AngularFireDatabase, AngularFireObject } from 'angularfire2/database'; import { User } from 'firebase/app'; import { Profile } from '../../models/profile/profile.interface'; import "rxjs/add/operator/take";

/* Generated class for the DataProvider provider.

See https://angular.io/guide/dependency-injection for more info on providers and Angular DI. */ @Injectable() export class DataServiceProvider {

profileObject: AngularFireObject

constructor(private database: AngularFireDatabase) { }

getProfile(user: User){ this.profileObject = this.database.object(/profiles/${user.uid}, { preserveSnapshot : true});

return this.profileObject.take(1);

}

async saveProfile(user: User, profile: Profile){ this.profileObject = this.database.object(/profiles/${user.uid})

try {
 await this.profileObject.set(profile);
 return true;
}
catch(e) {
  console.error(e);
  return false;
}

} }=========================

i get error in return this.profileObject.take(1);

while i sign in the beep app than this error show:

TypeError: this.profileObject.take is not a function at DataServiceProvider.webpackJsonp.360.DataServiceProvider.getProfile (http://localhost:8100/build/main.js:251:35) at LoginPage.webpackJsonp.718.LoginPage.login (http://localhost:8100/build/1.js:426:23) at Object.eval [as handleEvent] (ng:///LoginPageModule/LoginPage.ngfactory.js:34:35) at handleEvent (http://localhost:8100/build/vendor.js:14274:155) at callWithDebugContext (http://localhost:8100/build/vendor.js:15783:42) at Object.debugHandleEvent [as handleEvent] (http://localhost:8100/build/vendor.js:15370:12) at dispatchEvent (http://localhost:8100/build/vendor.js:10689:25) at http://localhost:8100/build/vendor.js:13028:38 at SafeSubscriber.schedulerFn [as _next] (http://localhost:8100/build/vendor.js:5039:36) at SafeSubscriber.__tryOrUnsub (http://localhost:8100/build/vendor.js:20899:16)

shindesharad71 commented 6 years ago

Sorry, @ParveenChhillar this project is not maintained, the errors might due to the new version of Angular and Ionic.