Issue adding new node in Angular

Hey Team,

I am trying to add a new node from the ngAfterViewInit hook of the consumer component and it doesn’t seem to work.
It works only when I wrap the code inside a setTimeout.

demo: Angular GoJs - StackBlitz
// Wrapping the below line in settimout will add the node properly
this.addDummyNode();

Please, let me know if I am missing anything here.

I think what you’re trying to do is somewhat contradictory. You specify the node data and the link data at:

<app-library [nodeList]="nodeList" [linkList]="linkList"></app-library>

So that is what it is displaying. If you wanted to modify that data, you could do so directly.

It is only after the GoJS model has the data that you supplied that you can modify the model and expect it to be modified the way that you want.