2
我想知道当我在这里使用这个Pubnub
函数时,我可以如何路由到不同的视图。Pubnub AngularJS hereNow函数 - 路由到不同的视图?
QueueController
Pubnub.hereNow(
{
includeUUIDs: true,
includeState: true
},
function (status, response){
console.log(response);
//do some algorithm with response
$location.path('/chat');
}
);
所以基本上我是从这个hereNow
功能,然后在内部的算法经过一个条件得到response
,我希望它从我的QueueController
去我ChatController
如此用户可以开始聊天!我甚至从函数中移除了算法,并且仅仅通过了路由,但它根本不起作用。
当我将$location.path('/chat')
放在我的hereNow
函数的之外时,它确实路由得非常好。
那么如何在这种情况下路线不同的看法?
我认为你需要的功能参数传递$位置,然后它会为你的答案工作 –
你好古拉姆感谢! – Student22
我的祝福:) –