SharePoint Framework client-side web part sample with Angular Elements


Greeting Web Part




This web part is created with Angular Element. It has one element “issharepoint” which takes true if user is running this web part in SharePoint environment.

Basically it shows current User Name, Title, Picture Url from “sp.profiles.myProperties” & Web Title from web object.

Here is the custom element created :
<app-greeting-wp-web-part issharepoint=${true} ></app-greeting-wp-web-part>

Just download code from GitHub and install dependencies. I am using PnP JS to get data from SharePoint.

I don’t want to run npm install every time when I am making any changes. So I made a small change in the project by adding a new file called “copyfile.js”. This file copies the “bundle.js” file to SPFx @node_modules folder. So you have to make changes in the destination path in the file.

Thanks to Stefan Bauer for @pnp/spfx and Andrew Connell for blog

Comments

Popular Posts

SharePoint Interview Questions and Answers

Download Infopath Form Templates

How to get current logged user information using JavaScript ?

Steps to set Form based authentication (FBA) for SharePoint 2010

SharePoint Interview Questions and Answers II

Get List Items - JavaScript

Change Language for current user with JSOM in SharePoint Online

Cross Site List Rollup Web Part for SharePoint 2010

Hide Recently Modified Items

SharePoint 2010 CSS Chart