angular.js - angularjs implements Form form submission information login. After clicking "Login", use state.go to jump to transfer data. How to accept the data after the jump?
世界只因有你
世界只因有你 2017-05-15 16:54:10
0
1
701

angularjs implements Form form submission information login. After clicking "Login", use state.go to jump to transfer data. How to accept the data after the jump?

//Code to implement jump
$state.go('landing_page',{'phone':$scope.phone,'validCode':$scope.validCode});

The phone and validCode here are the data I need to pass.

ps: Is the form submission page jump implemented in this way? Or is it better to use location?

世界只因有你
世界只因有你

reply all(1)
曾经蜡笔没有小新

1. It is possible to transfer data in this way, but there will be some minor problems. If you enter the landing_page status page that jumps, if you refresh this page, then the parameters you passed with the route (except route parameters) It will be gone, which is more embarrassing; so a good suggestion is to process the data you need before jumping to the route.
2. If these parameters are 路由参数, then the above problems will not occur, and the routing parameters will always be saved in the route.
3. If the parameters you pass with the route are also needed on the page after the jump, then you need to get them again before entering this page. You can try to use the ui-router插件的resolve method to get some of the data you need, and then inject it into the corresponding in the controller.

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