I have tried to implement crud operation in SharePoint using AngularJS. I have followed this link.

But in this case, it is taking the appwebURL instead of hostwebURL. So it is not able to retrieve or insert data to SharePoint list.

So I wanted to know, how do we handle appwebURl and HostwebURL when we use AngularJS for SharePoint Hosted Apps.

enter image description here

  • URL in the screenshot is the host web URL. It is not the App web URL. If you want to be over sure then paste the URL in your browser. It will redirect you to the host site. Jul 26, 2016 at 11:17

1 Answer 1


It is not taking app web url. May be you have missed the last part of my article.

For SharePoint Hosted App, _spPageContextInfo.siteAbsoluteUrl will give you the host web url.

Check the following part again.

In the baseSvc.js, we have to use _spPageContextInfo.siteAbsoluteUrl instead of _spPageContextInfo.webAbsoluteUrl for baseUrl.

PS: In my sample code there is a working solution. My app is using host web's list. So you should not face any issue if you are following my sample code properly.

To your Last update

You have posted the screenshot with the value of _spPageContextInfo.siteAbsoluteUrl. Yes it is pointing to the host web url. Just try to operate CRUD.

App web I mean the value of _spPageContextInfo.webAbsoluteUrl should be different. According to your screenshot, it should be

  • when I deploy it, App page is opened and then I have checked in the browser _spPageContextInfo.siteAbsoluteUrl gives me the same app page url.
    – KumarV
    Jul 17, 2016 at 11:48
  • still you are missing something. see my updated answer. Jul 17, 2016 at 13:17

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.