阅读背景:

AngularJS服务在控制器之间传递数据

来源:互联网 

When using an AngularJS service to try and pass data between two controllers, my second controller always receives undefined when trying to access data from the service. I am guessing this is because the first service does a $window.location.href and I'm thinking this is clearing out the data in the service? Is there a way for me to change the URL to a new location and keep the data persisted in the service for the second controller? When I run the code below the alert in the second controller is always undefined.When using an AngularJS service to try and pass




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: