How to connect signalR from angularJs
<p>I am developing web application in .NET as two separate applications, back end using webapi c# and user interface using AngularJS. I just want to add Chat option in this project. I have installed SignalR and added ChatHub.cs class in webapi.</p>

<p><a href="http://i.stack.imgur.com/FJTHy.jpg" rel="nofollow">enter image description here</a></p>

<p>in WebAPI there is a class named Startup.cs</p>

<pre><code>public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        HttpConfiguration config = new HttpConfiguration();
        config.Formatters.JsonFormatter.SerializerSettings.DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Local;
        WebApiConfig.Register(config);
        app.UseCors(CorsOptions.AllowAll);
        ConfigureAuth(app);
        app.UseWebApi(config);

        app.MapSignalR();//added after installation of SignalR package
    }
}
</code></pre>

<p>ChatHub class </p>

<pre><code>public class ChatHub : Hub
{
   public static string emailIDLoaded = "";
    public void Connect(string userName, string email)
    {
        emailIDLoaded = email;
        var id = Context.ConnectionId;
        using (SmartCampEntities dc = new SmartCampEntities())
        {

                var userdetails = new ChatUserDetail
                {
                    ConnectionId = id,
                    UserName = userName,
                    EmailID = email
                };
                dc.ChatUserDetails.Add(userdetails);
                dc.SaveChanges();

               }
            }

        }
</code></pre>

<p>Whatever request i send from user interface it will hit to its corresponding controller in webAPI. For example</p>

<pre><code> $http({
    method: 'GET',
    url: $scope.appPath + "DashboardNew/staffSummary"  //[RoutePrefix]/[Route]
}).success(function (result, status) {
    data = result;
});
</code></pre>

<p>My user interface is a separate application. How can i connect signalR from UI.
I tried something but didn't get it work. Can anyone suggest me how to get it work</p>

<p>html code</p>

<pre><code>&lt;div&gt;    
&lt;a class="btn btn-blue"  ng-click="sendTask()"&gt;SendTask&lt;/a&gt;
</code></pre>

<p>  </p>

<p>javascript</p>

<pre><code>angular.module('WebUI').controller('DashboardCtrl', function ($scope, $window, $http, $modal, ngTableParams) {
$scope.header = "Chat";

 $scope.sendTask = function () {
    $http({
        method: 'POST',
        url: $scope.appPath + hubConnetion.server.sendTask("userName","email"),
    })   
}
</code></pre>

<p>});</p>