Changing the category of a link

Yes changing the strokeDashArray is easy, but in my case
image
sometimes dashed without arrow head and sometimes
image
normal with arrow head…
Basically im just setting the template for link on callback event

  private linkDrawEvent = (e: go.DiagramEvent) => {
    const { toNode, toPort } = e.subject;
    if (toNode?.data.category === CanvasEntitiesCategory.TEXT_ANNOTATION) {
      this.diagramModel.setCategoryForLinkData(
        e.subject.data,
        CanvasEntitiesCategory.CONNECTOR
      );
    }
  }

but if i dont use linkTemplate then it would become hard for me change the template, but also because of the class changing limitation category set is getting stuck.
I hope you got my point.

linkTemplate code for reference: Typescript (forked) - StackBlitz