5
I have a little project with WebApi
,SignalR
and Angularjs
where I do some queries and inserts in real time. Everything works fine when I start the file index.html
right when running the application, but if I try to run the file individually, even with the application circling I have the following error:
hub is Undefined
The error starts in this line of my controller:
hub.client.addItem = function(item) {
$scope.comments.push(item);
$scope.$apply();
}
And I define the hub at the beginning, that way:
var hub = $.connection.myHub;
Working Hub(Running directly on the VS server):
Hub not working(Running on a Python server):