mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 17:27:48 +00:00
first draft hub connection
This commit is contained in:
@@ -26,5 +26,19 @@
|
||||
</head>
|
||||
<body>
|
||||
<my-app>Loading...</my-app>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var broadcaster = $.connection.broadcaster;
|
||||
|
||||
broadcaster.client.message = function (text) {
|
||||
alert(text);
|
||||
};
|
||||
|
||||
$.connection.hub.start().done(function () {
|
||||
broadcaster.server.broadcast('hello from client');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user