Closed parveen-chhillar closed 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});
/profiles/${user.uid}, { preserveSnapshot : true}
return this.profileObject.take(1);
}
async saveProfile(user: User, profile: Profile){ this.profileObject = this.database.object(/profiles/${user.uid})
/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)
Sorry, @ParveenChhillar this project is not maintained, the errors might due to the new version of Angular and Ionic.
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}
);}
async saveProfile(user: User, profile: Profile){ this.profileObject = this.database.object(
/profiles/${user.uid}
)} }=========================
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)