I have a project with WebApi
, SignalR
and Angularjs
where I do some queries and insertions in real time. Everything works fine when I start the file index.html
direct when running the application, however if I try to execute the file individually, even with the application hovering 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, this way:
var hub = $.connection.myHub;
Hub running (Direct running on VS server):
Hubnotworking(RunningonaPythonserver):