search

Home  >  Q&A  >  body text

angular.js - How does angular route implement data transfer when switching single pages?

I encountered a problem when using angular's route, as shown in the picture below,

When I click on the query, I send the number to the background through $http, and then the background returns the data to me. At this time, I want to jump to another route. How do I use it in another route page? The data previously returned to me by the background?

PHP中文网PHP中文网2864 days ago577

reply all(1)I'll reply

  • 仅有的幸福

    仅有的幸福2017-05-15 17:01:04

    If you use the ui-router plug-in, you can transfer data during route jump (recommended method) ui-router passes value

    You can also consider placing the data in the service and reading the data from the service after jumping there.

    You can also consider using events for data transfer.

    Reference material:
    Controller communication method in angular

    reply
    0
  • Cancelreply