Hi, I have created a custom node and installed it in nodered. It appears in manage-pallette but not in the category.
my package.json
{
"name" : "node-red-contrib-simulation-quantity-add",
"node-red" : {
"nodes": {
"quantity-add": "quantity-add.js"
}
}
}
quantity-add.html:
<script type="text/javascript">
RED.nodes.registerType('quantity-add',{
category: 'function',
color: '#a6bbcf',
defaults: {
name: {value:""},
type: {value:""}
},
inputs:1,
outputs:1,
icon: "file.png",
label: function() {
return this.name||"quantity-add";
}
});
</script>
<script type="text/html" data-template-name="quantity-add">
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-type"><i class="fa fa-tag"></i> Quantity type</label>
<input type="text" id="node-input-type" placeholder="Type">
</div>
</script>
<script type="text/html" data-help-name="quantity-add">
<p>A digitalTwin simulation's custom node for adding quantity</p>
</script>
quantity-add.js :
module.exports = function (RED) {
function QuantityAddNode(config) {
RED.nodes.createNode(this, config);
var node = this;
var type = config.Type;
node.on('input', function (msg) {
node.send(type);
});
}
RED.nodes.registerType("quantity-add", QuantityAddNode);
}