Skip to content

Instantly share code, notes, and snippets.

@cmatskas
Last active April 23, 2020 22:31
Show Gist options
  • Save cmatskas/0682edcc1b5bfd5e5c340e50cc5f3236 to your computer and use it in GitHub Desktop.
Save cmatskas/0682edcc1b5bfd5e5c340e50cc5f3236 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://unpkg.com/@microsoft/mgt/dist/bundle/mgt-loader.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
<mgt-msal-provider
client-id="<your client ID>"
authority="https://login.microsoftonline.com/<your AD tenant ID>"
</mgt-msal-provider>
<title>MS Graph Toolkit demo</title>
</head>
<body>
<div class="jumbotron">
<h1>MS Graph toolkit demo</h1>
<p class="lead">Let's get logged in and pull some MS Graph data using the toolkit!</p>
</div>
<div class="container">
<div class="row">
<div class="col" style="text-align: right;">
<mgt-login></mgt-login>
</div>
</div>
<div class="row">
<div class="col-6">
<h2>Emails</h2>
<mgt-get resource="/me/messages" version="beta" scopes="mail.read" max-pages="2">
<template>
<div class="email" data-for="email in value">
<h4>
<mgt-person person-query="{{email.sender.emailAddress.address}}" show-name person-card="hover"></mgt-person>
</h4>
<h4>{{ email.subject }}</h4>
<div data-if="email.bodyPreview" class="preview" innerHtml>{{email.bodyPreview}}</div>
<div data-else class="preview">
email body is empty
</div>
<div><strong>Received on: </strong>{{ email.receivedDateTime }}</div>
<hr>
</div>
</template>
<template data-type="loading">
loading
</template>
<template data-type="error">
{{ this }}
</template>
</mgt-get>
</div>
<div class="col-6">
<h2>Agenda</h2>
<mgt-agenda></mgt-agenda>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment