private getServer()
{
return this.db.list('/shopping-carts/').snapshotChanges().toPromise();
}
private async getOrCreateCartId() //to create a cartid or acceess the cartid
{
let cartId = localStorage.getItem('cartId'); //to create a cartid or acceess the cartid
if(cartId)
{
return cartId;
}
this.id = await this.getServer();
console.log(this.id);
console.log(this.cartIdFire);
if(this.cartIdFire)
{
return this.cartIdFire;
}
return "return something for testing";
}
after calls the getServer() angular drops the execution of this service even the method getorCreated() is not completed or console.log(this.id); is not printed nothing on console and return nothing totaly dropped the service. what kind of behaviour of this ?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…