import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Injector } from '@angular/core';
import { ApptorCanvasComponent } from './canvas/canvas.component';
import { createCustomElement } from '@angular/elements';
import {GojsAngularModule} from 'gojs-angular';
@NgModule({
declarations: [],
imports: [
BrowserModule,
GojsAngularModule
],
providers: [],
entryComponents: [CanvasComponent]
})
export class AppModule {
constructor(private injector: Injector) {
}
ngDoBootstrap() {
const widget: any = createCustomElement(CanvasComponent, { injector: this.injector });
customElements.define('canvas', widget);
}
}
in canvas-component.ts file
import * as go from 'gojs';
import { DataSyncService, DiagramComponent, PaletteComponent } from 'gojs-angular';
npm run build giving error
‘gojs-palette’ is not a known element:
- If ‘gojs-palette’ is an Angular component, then verify that it is part of this module.
- If ‘gojs-palette’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.