sp-dev-fx-webparts/samples/angular-msgraph
Vesa Juvonen 71e0031828 Added SPFx version indicator to readme files for all samples. 2016-12-13 11:26:45 +02:00
..
.vscode initial commit 2016-11-18 11:14:42 -05:00
assets initial commit 2016-11-18 11:14:42 -05:00
config initial commit 2016-11-18 11:14:42 -05:00
src Updated telemetry details on readme 2016-11-28 15:28:37 +02:00
typings initial commit 2016-11-18 11:14:42 -05:00
.editorconfig initial commit 2016-11-18 11:14:42 -05:00
.gitattributes initial commit 2016-11-18 11:14:42 -05:00
.gitignore initial commit 2016-11-18 11:14:42 -05:00
.npmignore initial commit 2016-11-18 11:14:42 -05:00
.yo-rc.json initial commit 2016-11-18 11:14:42 -05:00
README.md Added SPFx version indicator to readme files for all samples. 2016-12-13 11:26:45 +02:00
angular-msgraph.njsproj initial commit 2016-11-18 11:14:42 -05:00
copyTemplatesTask.js initial commit 2016-11-18 11:14:42 -05:00
gulpfile.js initial commit 2016-11-18 11:14:42 -05:00
package.json initial commit 2016-11-18 11:14:42 -05:00
setBaseUrlTask.js initial commit 2016-11-18 11:14:42 -05:00
tsconfig.json initial commit 2016-11-18 11:14:42 -05:00
tsd.json initial commit 2016-11-18 11:14:42 -05:00

README.md

Angular MS Graph Web Part Built with Angular v1.x

Summary

Sample MS Graph Web Part that connects to the Microsoft Graph and pull SharePoint information from your tenant. It will first pull the Root Site Collection (currently a limitation by Microsoft Graph). Then will display all the Lists associated with the site. Then all the items inside the List.

First Screen

Logged In

Root Site Collection

Lists in Root Site

Announcement List Items

Note: I currently only have models developed for the Announcements List. All other lists will currently generate errors.

Used SharePoint Framework Version

drop

Applies to

Solution

Solution Author(s)
angular-msgraph David Hartman (Slalom)

Version history

Version Date Comments
1.0 October 14, 2016 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Configuration Bliss

  • clone this repo
  • in the command line run:
  • npm i typings -g
  • npm i
  • `gulp serve

Register the application

  1. Sign into the App Registration Portal using either your personal or work or school account.

  2. Choose Add an app.

  3. Enter a name for the app, and choose Create application.

    The registration page displays, listing the properties of your app.

  4. Copy the Application Id. This is the unique identifier for your app.

  5. Under Platforms, choose Add Platform.

  6. Choose Web.

  7. Make sure the Allow Implicit Flow check box is selected, and enter http://{Location of SP Workbench} as the Redirect URI.

  8. Choose Save.

Configuring the App

  1. Replace the aad and redirect_uri placeholder values with the application ID and redirect url of your registered Azure application in the GraphHelper.ts file Under src -> angularMsGraph -> GraphHelper.ts
  • In the file 'AngularMsGraphWebPart.ts' around line 50 you will need to put the url of the directory where the html template file resides.

Note: Adding the location of the template is necessary because Angular's $sce service doesn't trust the location the html template is loaded from, so the url needs to be whitelisted with the $sce service. If you just want whitelisted every url the entry in the $sce could just be '*'. There is plenty of documentation available if you run into trouble whitelisting the template url.