Ionic-Angular lifecycle vs Angular signals

Discussão em 'Angular' iniciado por SebastianoFazzino, Abril 13, 2025.

  1. I'm following an old guide about building mobile apps using ionic with angular. In there it's explained that because of ionic page caching I might have some side effects when it comes to state management, however I'm not experiencing these side effects using signal.

    Here's a code example

    export class RecipesPage {
    private recipesService = inject(RecipesService);

    recipes = this.recipesService.getRecipes(); //This returns a signal
    }



    From this page I can navigate into a recipe-detail page and in there I can delete any recipe; after doing that I'm redirected back to recipe page. After deleting a recipe, I see that the list of recipes is updated, however in this old guide it's suggested to handle state management inside ionic hook 'ionViewWillEnter' to avoid side effects.

    So my question is, due to signal, is still needed to handle state management using ionic hooks, or modern tools like signals or reactive services have changed this behavior?

    Continue reading...

Compartilhe esta Página