We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

ejDiagram: methods/properties can be accessed only after plugin

Thread ID:





133064 Oct 6,2017 02:38 PM Oct 9,2017 11:55 PM Angular 3
Tags: ejDiagram
Julian Lyndon-Smith
Asked On October 6, 2017 02:38 PM

I was trying to look at the json produced by the :save() method  in the `OnNgInit` method of my component, but get this error instead :

ejDiagram: methods/properties can be accessed only after plugin

How do I wait for the "after plugin" before attempting to access :save() ?

public ngOnInit() {
const diagram = $("#graph").ejDiagram("instance");


<ej-diagram height="100%" id="graph">
<e-node name ="Start" type = "flow" shape="terminator" [width]="140" [height]="50" [offsetX]="300" [offsetY]="50">
<e-nodelabel text="Start"></e-nodelabel>
<e-node name ="Init" type = "flow" shape="process" [width]="140" [height]="50" [offsetX]="300" [offsetY]="140">
<e-nodelabel text="var i = 0;"></e-nodelabel>
<e-connector name="connector1" sourceNode="Start" targetNode="Init">
<e-segment type="orthogonal"></e-segment>


I tried to look at the events, but couldn't find any information

Shyam G [Syncfusion]
Replied On October 9, 2017 04:58 AM

Hi Julian, 
Please use ngAfterViewInit method which triggers once the diagram is rendered. Please refer to the code example, sample and reference link to use that method. 
Code example: 
export class DiagramComponent implements AfterViewInit { 
            ngAfterViewInit() { 
                var diagram = $("#graph").ejDiagram("instance"); 
                var save=diagram.save(); 
Shyam G 

Julian Lyndon-Smith
Replied On October 9, 2017 05:03 AM

thanks - this worked

Shyam G [Syncfusion]
Replied On October 9, 2017 11:55 PM

Hi Julian, 
Please let us know if you need further assistance on this. 
Shyam G 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.