tx info sent to homepage.
This commit is contained in:
parent
2e959fa81c
commit
ada63f8488
@ -3,9 +3,3 @@ extends layouts/default
|
|||||||
block content
|
block content
|
||||||
section.container(data-ng-view)
|
section.container(data-ng-view)
|
||||||
|
|
||||||
div.row
|
|
||||||
div.span4
|
|
||||||
Test
|
|
||||||
div.span4
|
|
||||||
Test2
|
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,8 @@ var Transaction = require('../../models/Transaction');
|
|||||||
module.exports = function(app, io) {
|
module.exports = function(app, io) {
|
||||||
io.set('log level', 1); // reduce logging
|
io.set('log level', 1); // reduce logging
|
||||||
io.sockets.on('connection', function(socket) {
|
io.sockets.on('connection', function(socket) {
|
||||||
socket.emit('tx', Transaction.findOne());
|
Transaction.findOne(function(err, tx) {
|
||||||
socket.on('my other event', function(data) {
|
socket.emit('tx', tx);
|
||||||
console.log(data);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -8,7 +8,8 @@ angular.module('mystery.system').controller('IndexController', ['$scope', 'Globa
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
var socket = io.connect('http://localhost');
|
var socket = io.connect('http://localhost');
|
||||||
socket.on('tx', function(data) {
|
socket.on('tx', function(data) {
|
||||||
console.log(data);
|
var tx = data;
|
||||||
|
console.log('Transaction received! '+tx.txid);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user