search

Home  >  Q&A  >  body text

html5 - angular2 click event from the current page, route to the current page, the page does not refresh

Click another user in a user's homepage to jump to the user's homepage, that is, route from the current page to the same routing page, but the passed user ID is different, but the page does not refresh

The data is also refreshed, but the overall page remains unchanged and is not refreshed

There is no problem with routing configuration

为情所困为情所困2736 days ago1190

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-05-24 11:38:07

    My personal understanding is that when angular2 routes to this page, the routing path has not changed, so the page is not reloaded, but the parameters passed by the route have changed. According to logic, angular2 only changes the model data;
    There are two solutions Method;
    1. Clear all variables when getting routing parameters on this page to achieve page jump

    2. Set different routing paths to point to the same routing module

    reply
    0
  • Cancelreply