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

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

ความคิดเห็น • 7

  • @todisoarazafindrabekoto8429
    @todisoarazafindrabekoto8429 หลายเดือนก่อน

    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  หลายเดือนก่อน +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 หลายเดือนก่อน

      @@benandengineering ok, thanks a lot

  • @federicobalboa9145
    @federicobalboa9145 5 หลายเดือนก่อน +1

    thanks, do you have a github repo?

    • @benandengineering
      @benandengineering  5 หลายเดือนก่อน +1

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

    • @federicobalboa9145
      @federicobalboa9145 5 หลายเดือนก่อน +1

      @@benandengineering thank you!

    • @benandengineering
      @benandengineering  5 หลายเดือนก่อน

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