I'm using it with angular (ngx-blockly) and I want to create custom blocks like moveforward and so on ,so I followed all the steps in the tutorial ngx-blockly but I keep getting error about the type of the block and I didn't find information about the blocks type, is theres specific types when creating your own blocks , like in this tutorial the error was about "test"
here is the error enter image description here and here is my custom block code
import { CustomBlock, NgxBlocklyComponent } from 'ngx-blockly';
import { ViewChild } from '@angular/core';
declare var Blockly: any;
export class TestBlock extends CustomBlock {
constructor() {
super('TestBlock');
this.class = TestBlock;
}
defineBlock() {
this.block
.appendDummyInput()
.appendField(this.type)
this.block.setOutput(true, 'Input');
this.block.setColour(30);
this.block.setTooltip('');
this.block.setHelpUrl('');
}
toXML() {
return '<block type="test"></block>';
}
onChange(changeEvent: any) {
console.log(changeEvent);
}
toDartCode(block: CustomBlock): string | any[] {
return 'Not implemented';
}
toJavaScriptCode(block: CustomBlock): string | any[] {
return 'Not implemented';
}
toLuaCode(block: CustomBlock): string | any[] {
return 'Not implemented';
}
toPHPCode(block: CustomBlock): string | any[] {
return 'Not implemented';
}
toPythonCode(block: CustomBlock): string | any[] {
return 'Not implemented';
}
}