Showing posts with label spfx change baseurl. Show all posts
Showing posts with label spfx change baseurl. Show all posts

Tuesday, 19 March 2019

Configure properties in pnp



Below is the example how can we change the baseurl or other properties in pnp and connect to specific web using pnp in spfx


private pnpSPConfiguration():void
{
let headerOption:any=["Accept","application/json;odata=verbose"];
pnp.sp.configure(headerOption,this.context.pageContext.web.absoluteUrl+"/demo")
.web.lists.get().then(function(response)
{
console.log(response);
});
}