Skip to content

initializeModel

initializeModel(model, injector?): SignalModelAdapter

Creates a model adapter with initial nodes, edges, and metadata.

This helper sets up a model instance ready for use in ng-diagram. It must be run in an Angular injection context unless the injector option is provided manually.

⚠️ This is only for creating the initial model. Any changes to the model or access to current data should be done via NgDiagramModelService.

Partial<Model> = {}

Initial model data (nodes, edges, metadata).

Injector

Optional Angular Injector if not running inside an injection context.

SignalModelAdapter