I need to save a relative URL to a SharePoint subsite in the html controller of an Angular app I'm deploying directly to a page. I need the URL to be dynamic, so that when I save this site as a template, the URL will point to whatever the current site is.
In my HTML controller, I tried using
<a href="~site/List/ListName/AllItems.aspx">
This seems to work partially? It will print the current site, but then instead of it looking like "https://contoso.sharepoint.com/HR/List/ListName/AllItems.aspx" it prints it as "https://contoso.sharepoint.com/HR/~site/List/ListName/AllItems.aspx"
Am I doing something wrong or will I need to get the current site programmatically via REST?