首页 > angularjs,请问service里请求到的数据如何在controller里调用?

angularjs,请问service里请求到的数据如何在controller里调用?

是我少传$scope.infos的参数么?但是不知道放哪?


这个是异步获取,外面怎么可能有值呢。


controller 中传入参数 returnUrlName 然后就可以引用了、

比如

controller('StandarForce',function(...//其他参数,returnUrlName){
     returnUrlName.xxx//这个服务中的方法或者变量
})

这是promise模式,异步获取,外面拿不到值,需要在 then 里面才能拿到

【热门文章】
【热门文章】