Hi I have a form that insert data to storage, everything is ok but when i navigate to tabs again the tab content is not refreshing showing the new record, I try with the life cycles with no luck Ionviewillenter is not firing, I have to reload page manually to see changes this is my code:
form.page.ts
import { Component, OnInit } from ‘@angular/core’;
import { Router } from ‘@angular/router’;
import { FormsModule, NgForm } from ‘@angular/forms’;
import { PaymentService } from ‘…/services/payment.service’; ← spayments
import { NavController } from ‘@ionic/angular’; ← also try with navcontroller and nothing happens
async onSubmit(paymentForm: NgForm) {
let created: boolean;
//console.log(this.data);
await this.spayments.addPayment(this.data); ← Saves data ok
await this.goTabs();
}
async goTabs() {
await this.router.navigate([‘tabs’]);
//await this.navCtrl.(‘tabs’);
}
tab1.page.ts
import { Component, OnDestroy, OnInit } from ‘@angular/core’;
import { RouterModule, ActivatedRoute, Router } from ‘@angular/router’;
import { AlertController } from ‘@ionic/angular’;
ngOnInit() { <–Not loads
this.payments = [ ];
this.payments = this.getAllPayments();
console.log(this.payments);
}
async ionViewWillEnter() { <–not loads
console.log(‘si viewwillenter’);
await this.getAllPayments();
}