Add default Label along with Link

I am trying to add some default value to Link Data whenever a new link is added to diagram by user.

I want to show label on link, so my link template is as per following.

and i want to set some data for default use, so my code for that is as per following.

whenever a new link is added,instead of Label showing on link, it looks like following. But when a value of Name is found through link data, it bind properly.

You don’t set a default value for Shape.toArrow, so if there’s no value for data.toArrow, that Shape.toArrow won’t be set to anything, which means it does not act as an arrowhead at all.

And since you haven’t set any other properties on that Shape, other than Shape.stroke, it gets a default size of 100x100, just to make it obvious that you haven’t given it a size or figure or (in this case) an arrowhead.

By the way, do you have JavaScript code that sets the Shape.toArrow, Shape.strokeWidth, and Shape.stroke properties? If you don’t, there’s no reason to make those Bindings TwoWay: GoJS Data Binding -- Northwoods Software

Yes, i have that code, but when new link is added i was not setting it up.

Thanks it worked.