Linking tool and add property to the two linked node

So if I use a linking tool to draw a line between two nodes. How am I able to also get the two nodes and add a property?

The “LinkDrawn” DiagramEvent listener is passed one argument whose DiagramEvent.subject will be the newly drawn Link. http://gojs.net/latest/intro/events.html and http://gojs.net/latest/api/symbols/DiagramEvent.html

The connected Nodes will be the Link.fromNode and the Link.toNode. If you want to change properties on their model data, just do something like:

$(go.Diagram, "myDiagramDiv",
  { . . .,
    "LinkDrawn": function(e) {
      var link = e.subject;
      var from = link.fromNode;
      var to = link.toNode;
      e.diagram.model.setDataProperty(from.data, "someProperty", ...someValue...);
      e.diagram.model.setDataProperty(to.data, "someProperty", ...someValue...);
    },
    . . .
  })

Thanks. Works well.