Angular incremental json problem

i m working on a diagram in angular i need incremental json the diagram is a tree model so there are no links but on running this

if (e.isTransactionFinished) {
// this records each Transaction as a JSON-format string

i get error

The error indicates that you are using a GraphLinksModel, not a TreeModel.

but i m using a tree model

here tree

there is no link data array in it

In your Changed listener, when e.isTransactionFinished, see whether this.diagram.model instanceof go.GraphLinksModel is true.