Upshot.js + signalr + knockout

Is it possible to combine upshot / knockout with signalr (I can only find knockout and signalr questions)? For example, if I add a task using:

    self.addTask = function () {
        var task = new Task({
            LastUpdated : new Date().toMSJSON(),
             Title : this.newTaskText(),
             IsDone : true
         });
         self.tasks.unshift(task);
    }

in the view model, this will automatically add it to the view (based on the knockout data binding) and will call:

        public void InsertTask(Task task)
        {
            InsertEntity(task);
        }

on server. What if I also want to pass this on to other clients .. is it possible to use the same libraries? If so .. what changes do I need to do / additional things I need to do? Are there any alternatives that will make this easier, but still following the future stack of Microsoft ASP.NET MVC 4?

+3
source share
1 answer

You must be able to: on the server you can call

var connection = AspNetHost.DependencyResolver.Resolve<IConnectionManager().GetConnection<MyConnection>();
connection.Broadcast("Called from an mvc controller or server side method");

:

 self.addTask

"addTask" .

+1

All Articles