Angular | Create A Multi-step Form Using An Angular Service And Angular Dynamic Components

Поділитися
Вставка
  • Опубліковано 21 гру 2024

КОМЕНТАРІ • 7

  • @federicobalboa9145
    @federicobalboa9145 3 місяці тому +1

    thanks, do you have a github repo?

    • @benandengineering
      @benandengineering  3 місяці тому +1

      Most welcome, and also thank you for the reminder, just updated the video description with a link to the repository.

    • @federicobalboa9145
      @federicobalboa9145 3 місяці тому +1

      @@benandengineering thank you!

    • @benandengineering
      @benandengineering  3 місяці тому

      Welcome, and if you have any questions, feel free to ask.

  • @todisoarazafindrabekoto8429
    @todisoarazafindrabekoto8429 14 днів тому

    The form is reinitialized after reloading the page.
    E.g: actually, i am in step = 3, i refresh the page => the step become 1
    How to keep the current step after refresh the page?

    • @benandengineering
      @benandengineering  13 днів тому +1

      Hello and a pleasure to make your acquaintance.
      Okay, that is the expected behavior, because what happens is that the progress is tracked in memory i.e in the Angular Service. This means that each time you refresh the page, the Angular Service will be re-initialized and then the step will go back to step 1.
      So, what you could do is to sync the step with localstorage and then read the step the next time the application loads and set this in the Angular Service.
      I hope this helps.

    • @todisoarazafindrabekoto8429
      @todisoarazafindrabekoto8429 9 днів тому

      @@benandengineering ok, thanks a lot