angular.js - How does angular route implement data transfer when switching single pages?
PHP中文网
PHP中文网 2017-05-15 16:59:04
0
1
535

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中文网

认证0级讲师

reply all(1)
仅有的幸福

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template