Refreshing the diagram once when the given value for diagram.model changes

I’m not sure how I can do that.
So far I’m using GoJS in an AngularJS environment so it’s in a custom directive.

I tried using if statements by comparing directly if the current model data is the same as another model data, and if it was true to will assign the diagram.model to another model data, but that didn’t work.

I also tried using the AngularJS custom directive, where you have scope: { model: ‘=goModel’} as from the AngularJS samples, and I pass the value in the HTML tag as an attribute, but even if I change the attribute it doesn’t work. The attribute/value is able to change, but the graph doesn’t redraw at all.

How you can set the Diagram.model property, is there a method for that? And if so, how do can I be able to call that in my controller.