How to fix Automatic page redirection


#1

Hi,

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>


My root page is dashboard.ts.
I submit the button page redirect to root page.
But I do not write any code in page redirection.

Kindly advice me,

Thanks


#2

I find it confusing that your click handler is on the div rather than the button.


#3

Thanks for ur reply.I already tried this

<button ion-button full (click)="Submit(Editflat,images,$event)">Update</button>