0

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

1
  • 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. Commented Jul 26, 2016 at 11:17

1 Answer 1

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

https://site-guid.sharepoint.com/sites/test1/{appName}
2
  • 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. Commented Jul 17, 2016 at 11:48
  • still you are missing something. see my updated answer. Commented 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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.