tx info sent to homepage.
This commit is contained in:
parent
2e959fa81c
commit
ada63f8488
@ -3,9 +3,3 @@ extends layouts/default
|
||||
block content
|
||||
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) {
|
||||
io.set('log level', 1); // reduce logging
|
||||
io.sockets.on('connection', function(socket) {
|
||||
socket.emit('tx', Transaction.findOne());
|
||||
socket.on('my other event', function(data) {
|
||||
console.log(data);
|
||||
Transaction.findOne(function(err, tx) {
|
||||
socket.emit('tx', tx);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
@ -8,7 +8,8 @@ angular.module('mystery.system').controller('IndexController', ['$scope', 'Globa
|
||||
$(document).ready(function() {
|
||||
var socket = io.connect('http://localhost');
|
||||
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