Skip to content

Commit 1b7e46c

Browse files
author
Dave Conway-Jones
committed
fix handling of {{msg.property}} for label
1 parent 03d11fd commit 1b7e46c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/ui-component/ui-component-ctrl.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ angular.module('ui').controller('uiComponentController', ['$scope', 'UiEvents',
159159
}
160160
$scope.$watch('me.item.value', function() {
161161
if ((me.item.dynOutput === "true") && (me.item.value !== "")) {
162-
me.valueChanged(20); }
162+
me.valueChanged(20);
163+
}
163164
});
164165
break;
165166
}

ui.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ function add(opt) {
223223
if (b.indexOf(".") !== -1) { b = b.split(".")[0]; }
224224
if (b.indexOf("[") !== -1) { b = b.split("[")[0]; }
225225
if (!toEmit.hasOwnProperty(b) && msg.hasOwnProperty(b)) {
226-
if (Buffer.isBuffer(msg[b])) { toEmit.msg[b] = msg[b].toString("binary"); }
227-
else { toEmit.msg[b] = JSON.parse(JSON.stringify(msg[b])); }
226+
if (Buffer.isBuffer(msg[b])) { toEmit[b] = msg[b].toString("binary"); }
227+
else { toEmit[b] = JSON.parse(JSON.stringify(msg[b])); }
228228
}
229229
}
230230
}
@@ -238,7 +238,6 @@ function add(opt) {
238238
addField("units");
239239
if (msg.hasOwnProperty("enabled")) { toEmit.disabled = !msg.enabled; }
240240
toEmit.id = toStore.id = opt.node.id;
241-
242241
// Emit and Store the data
243242
//if (settings.verbose) { console.log("UI-EMIT",JSON.stringify(toEmit)); }
244243
io.emit(updateValueEventName, toEmit);

0 commit comments

Comments
 (0)