0

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?

1 Answer 1

0

Never mind... just decided to use an HTML relative URL. Using:

./Lists/ListName/AllItems.aspx

worked fine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.