I'm wondering how I can route to a different view when I'm working with this Pubnub
function here.
QueueController
Pubnub.hereNow(
{
includeUUIDs: true,
includeState: true
},
function (status, response){
console.log(response);
//do some algorithm with response
$location.path('/chat');
}
);
So basically I'm getting the response
from this hereNow
function and then when the algorithm passes a condition inside, I want it to go from my QueueController
to my ChatController
so the users can begin chatting! I even removed the algorithm from the function and had the route just by itself, but it doesn't work at all.
When I put the $location.path('/chat')
outside of my hereNow
function, it does route very nicely.
So how does one route to a different view in this case?