Hello,
I've been experimenting with custom nodes and I try to create a node that will output once two messages and that has no input. In the html file I've already specified that I have no input and two outputs. My problem is in the .js file. In all of the examples that I've seen the .js file is written like this:
module.exports = function(RED) {
function MyFunction(config) {
RED.nodes.createNode(this,config);
// some stuff to deal with the defaults of the html file
var node = this;
node.on('input', function(msg)) {
// my function
node.send(msg);
}
}
RED.nodes.registerType("my-function",MyFunction);
}
The problem is that I do not have an input to trigger node.on, so how do I do this part?