I'm trying to use Blockly in an Angular 7 application but I'm unable to inject the Blockly editor.
I have downloaded the files from https://developers.google.com/blockly/guides/get-started/web and copied blockly_compressed.js into my src directory (and renamed it blockly.js). I then try to access Blockly from my component and get errors.
What I have tried:
import "../blockly.js"
Does not compile, gives "error TS2304: Cannot find name 'Blockly'."
import { Blockly } from '../blockly'
Compiles, but gives the following error when the app is opened in a browser:
ERROR TypeError: _blockly__WEBPACK_IMPORTED_MODULE_4__.Blockly.inject is not a function
Adding a blockly.d.ts file with the following:
export namespace Blockly {
export function inject(div: string, config: any): void;
}
Gives the same error as above.
Any suggestions on what else I could try?