I am using ionic 2.
I used form
Here is my code.
<form [formGroup]="Editflat" novalidate>
<ion-item>
<ion-label floating>About flat</ion-label>
<ion-textarea class="textareadesc" elastic formControlName="ABOUT_FLAT">
</ion-textarea>
</ion-item>
<ion-item>
<ion-label floating>Area</ion-label>
<ion-input type="text" formControlName="AREA"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>BHK</ion-label>
<ion-input type="text" formControlName="BHK"></ion-input>
</ion-item>
<ion-item >
<ion-label floating>Rent Amount</ion-label>
<ion-input type="text" formControlName="RENT_AMOUNT"></ion-input>
</ion-item>
<ion-item >
<ion-label floating>Sale Amount</ion-label>
<ion-input type="text" formControlName="SALE_AMOUNT"></ion-input>
</ion-item>
<ion-item class="check">
<ion-label>Rent</ion-label>
<ion-checkbox checked="{{rent}}" (ionChange)="change($event)"></ion-checkbox>
</ion-item>
<ion-item class="check">
<ion-label>Sale</ion-label>
<ion-checkbox checked="{{sale}}" (ionChange)="change($event)"></ion-checkbox>
</ion-item>
<ion-item>
<ion-label floating>Current rent amount</ion-label>
<ion-input type="text" formControlName="CURRENT_RENTAMOUNT"></ion-input>
</ion-item>
<div class="btn" (click)="Submit(Editflat,images,$event)">
<button ion-button full>Update</button>
</div>
</form>
Here is my submit function
Submit(value,imagevalue,event)
{
//event.stopPropagation();
this.platform.ready().then(() => {
window.plugins.toast.show("Please wait...", "short",'bottom',3000);
});
var imagevalue1=imagevalue;
var Result = moment().format('YYYY-MM-DD HH:mm:ss');
this.Editflat.controls['UPDATEDDATE'].setValue(Result);
var f=this.af.database.list('/flats');
f.update(this.key,this.Editflat.value);
}
Once I update the data to Firebase thereafter page redirection without a push.Why?
KIndly advice me,
Thanks