i'm incorporating signalr project i'm using require.js handle scripts dependencies.
i'm having little trouble making sure "/signalr/hubs" called after "jquery.signalr-1.1.2" loads.
i got work, i'm wondering if there better alternative out there.
this have:
require(["signalr"], function () { require(["noext!/signalr/hubs"], function () { //initialize , work hub here } }
is there way can create shim here establish dependency between signalr/hubs , signalr script?
thanks!
this works me signalr 1.1.2:
require.config({ baseurl: "/<your scripts dir>", paths: { "jquery": "jquery-<your jquery version>.min", "signalr.core": "jquery.signalr-<your signalr version>.min", "signalr.hubs": "/signalr/hubs?" }, shim: { "jquery": { exports: "$" }, "signalr.core": { deps: ["jquery"], exports: "$.connection" }, "signalr.hubs": { deps: ["signalr.core"], } } }); require(["jquery", "signalr.hubs"], function($) { var hubproxy = $.connection.myhub; // ... go town ... });
Comments
Post a Comment