In the navigation bar on the Sharpoint 2013 page I'm working on there is a link called News. If I click on it I navigate to a new page where I can see all the news blogs. I'm having difficulty writing the right get request in angularjs to get this url. I need this url for an "See all" link I have on my home page that is underneath all the links that navigate to each news.

Sometimes the News url looks like this: .../sites/easySTART/frettir/_layouts/15/start.aspx#/default.aspx <--- navigated from the blog list

and sometimes like this: .../sites/easySTART/frettir/default.aspx <-- navigated from the home page

it depends on where I'm navigating from.

This is my angularjs code:

  //+ "/_api/lists/getbytitle('" + newsList + "')
  $http.get("/sites/easySTART/" + newsBlogName + "/DefaultView").
  success(function(data, status, headers, config) {
    $scope.allNews = data.value;
  error(function(data, status, headers, config) {

I've tried many different versions, this one is completely wrong I just get "404 NOT FOUND". Now I just have the url hardcoded in my html, but I don't want that because the variable newsBlogName can vary between users of this solution, depends on the name of the blog.

This is my html and I want to use ng-href there:

<div class="adv_show_all_link adv_show_all_link_news">
    <a id="adv_see_all" href="https://advaniasky.sharepoint.com/sites/easySTART/frettir/default.aspx">See all</a> <!-- Needs a fix, don't want the link to be hardcoded -->

I'm really new to Sharepoint so I will be thankful for any help I can get :) ...hope my question is not to vague.

1 Answer 1


Try removing the Default.aspx altogether using only the site path.


The weird url woth _layouts that you see at the top is due to a feature called Minimal Download Strategy, that is used to only refresh certain parts of the page to improve performance. I personally don't like neither the URL it forms nor some issues it causes, so typically try to turn it off from Site Settings > Manage Site Features> Minimal Download Strategy (MDS).

  • I tried to fetch the url like this but just got undefined. Not sure if it is possible to get this url, if the API even offers it. So instead I just build up the url by using window.location.host from the homepage, extract what I don't need and add what I need. I'm completely new to this, just started working with a Sharepoint team at a software company. Commented Feb 13, 2015 at 12:17
  • Is the code being executed from the same site collection or a different one? I.e. sites/easySTART Commented Feb 13, 2015 at 12:23
  • It's injected in the webpart Commented Feb 16, 2015 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.