<div id="{{'my_'+$id}}" style="{{'color:'+theme.base_color}}">Some text</div>
<script>
(function(scope) {
scope.$watch('msg', function(msg) {
if (msg) {
// Do something when msg arrives
$("#my_"+scope.$id).html(msg.payload);
}
});
})(scope);
</script>
This uses JQuery to update the html using the id of the element.
So if you add a scope.$watch you could update the document on the fly as variables change.
Also probably best to uncheck "pass through messages from input" if not required and "Add output messages to stored state"