SOLVED

PnP-JS-Core open web by url?

Highlighted
New Contributor

Every example I see of PnP-JS-Core uses the current web. How can I open a list from another web?

3 Replies
Highlighted
have not seen the code but i guess you need to create your own clientcontext with site url and then go to the correct web.
Highlighted

That's how you do it with CSOM, but PNP-Core is a wrapper for the REST services. Makes lots of things easier, but documentation is sketchy. Thanks for the response.

Highlighted
Best Response confirmed by Clifford Adams (New Contributor)
Solution

For anyone else searching for this. Here's how you do it:

var w = new $pnp.Web("/news");
w.lists.getByTitle("Alerts")....