you got me thinking again :-)
there is a websocket which receives the new data as it comes in, see below
this piece of javascript is receiving the new data
i will try out some options for this
thanks sofar
primus.$on('data', function (data) {
if (data.topic) {
var parts = data.topic.split('/');
// "value/org3/temp"
console.log(parts.length)
console.log(parts[0])
console.log(parts[1])
if ((parts.length === 2) && (parts[0] === 'smartmeter')) {
console.log("Gevonden: "+JSON.stringify(data));
var f = false;
for (var i = 0, len = $scope.friends.length; i < len; i++) {
if ($scope.friends[i].ctx === parts[1]) {
$scope.friends[i].value = data.payload;
f = true;
break;
}
}
if (!f) {
var nit = {};
nit.ctx = parts[1];
nit.value = data.payload;
$scope.friends.push(nit);
console.log($scope.friends[0]);
}
}
}
});
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.