Trying to display the key/value pairs from the server in Angular using RxJS.
Below is the code snippet:
let listener = c.listenFor('addMessage');
listener.subscribe(mesg => {
console.log(mesg);
});
However, it currently only prints the keys:
FIELD_NAME
KVD_VRT
What I want to achieve is:
FIELD_NAME:9.02798989742435
KVD_VRT:2.96959280174672
My JavaScript code is working fine, but I am not sure how to achieve the same thing in Angular:
chat.client.addMessage = function (name, message) {
// Html encode display name and message.
var encodedName = $('111').text(name).html();
var encodedMsg = $('<div >').text(message).html();
// Add the message to the page.
$('#discussion').append('<li><strong>' + encodedName
+ '</strong>: ' + encodedMsg + '</li>');
};
I am uncertain how Angular handles subscribing to key/value data.
Any assistance would be greatly appreciated.