SlideShare a Scribd company logo
SharePoint Framework, Angular and
Azure Functions
by Sébastien Levert
Our Sponsors
GOLD
SILVERLOCATION
BRONZE
MEDIA
Hi! I’m Seb!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
Agenda
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Functions
SPFx + Angular
Angular… But which version ?
• Works well with Angular 1.6
• Works OK with Angular 2
• Works awesome with Angular 4 (Did you just say Angular 4!?)
• Works even better with Angular 5 (NgElement to the rescue!)
Is that even possible ?
• Some are thinking it is mission impossible… But it is! And it’s much
more simpler than you think.
• You have the full power of Angular within you own SPFx webparts
• Multiple webparts can exist in a page, including their own routing
configuration
And then…That happened.
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Functions
Embedding an Element
public render(): void {
this.domElement.innerHTML = `
<hello-world
name="${this.properties.name}">
</hello-world>`;
}
Routing
const routes: Routes = [
{ path: '', component: SitesComponent, children: [
{ path: '', component: SitesHomeComponent },
{ path: 'sites', children: [
{ path: 'new', component: SitesFormComponent },
{ path: ':id', component: SitesViewComponent }
]},
]}
];
import { appRoutes } from "./app/app.routes"
protected get routes(): any {
return appRoutes;
}
Global Configurations
import { ConfigurationService } from
"./app/services/ConfigurationService";
ConfigurationService
{ provide: APP_INITIALIZER, useFactory: (configurationService:
ConfigurationService) => () => configurationService.load({
functionUrl: this.properties.functionUrl,
functionKey: this.properties.functionKey,
description: this.properties.description,
styles: styles
}), deps: [ConfigurationService], multi: true }
Mocking Data
if (Environment.type === EnvironmentType.Local) {
return [
{ provide: SitesService, useClass: MockSitesService },
];
} else if (Environment.type == EnvironmentType.SharePoint ||
Environment.type == EnvironmentType.ClassicSharePoint) {
return [
{ provide: SitesService, useClass: SitesService },
];
}
Mocking Data
export class MockSitesService implements ISitesService {
public createSite(siteInformation: ISiteCreationInformation):
Observable<ISiteCreationResponse> {
return Observable.of<ISiteCreationResponse>({
description: `${siteInformation.description} (Mocked)`,
email: `${siteInformation.url}@mocked.onmicrosoft.com`,
id: "00000000-0000-0000-0000-000000000000",
title: `${siteInformation.title} (Mocked)`,
url: `#${siteInformation.url}`
}).delay(2000);
}
}
Azure Functions
Why Azure Functions ?
• Cheap way to host any API in Azure
• You can use your favorite language
• Super cheap to run
• Perfect companion for any Single Page Application or any JavaScript
component
Our scenario
• Using the PnP PowerShell Cmdlets
• Connecting to the Microsoft Graph and to an Azure AD Application
• Creating a ModernTeam Site (in under 15 seconds) based on a set of
parameters
• Boom!
Make it happen
The full scenario
• Build a SharePoint Framework WebPart
• Use Angular as our main Framework
• Include 3 routes (Home, New Site and Site Information)
• Use Azure Function as my backend provisioning API
• Use the Office UI Fabric components
What about the Office UI Fabric ?
• Well…You have 2 choices : Build or Reuse
• My choice ? Reuse !
• But Seb… It’s Angular, I can’t reuse what does not exist…
• Well…The React components exist, just reuse them !
Downsides
• Can’t use the CLI to build new components and slow to compile
• Can’t use AOT to reduce the bundle size
• Lots of “hacks” in code that make this approach…
• Clearly not SPCAF compliant!
Lessons learned
• Never use any class or ids from the DOM. Always use theViewChild
attribute.
• You can use html templates using the require() approach.Try to do
that, React!
• When you have a strong AngularJS background, it feels just a little bit
weird to move to Angular, but you will get used to it!
And… Should I use it in production?
• As of today, this approach is the only approach that works.
• Use it to experiment, to learn the SharePoint Framework and
Angular altogether.
• Will require a lot of maintenance with new versions of SPFx… In
short, I would not go all in right now… But…
But…
Next Steps
Resources
• https://github.com/SharePoint/sp-dev-fx-
webparts/tree/master/samples/angular2-prototype
• https://dev.office.com/sharepoint/docs/spfx/sharepoint-framework-
overview
• http://dev.office.com/fabric#/components
• https://www.youtube.com/watch?v=Vkzr2TxHFLg&t=6s
Samples
• https://github.com/sebastienlevert/spfx-angular-boilerplate
• https://github.com/SharePoint/sp-dev-fx-webparts
Sharing is caring
• Use hashtags to share your experience
• #Office365Dev
• #MicrosoftGraph
• #AzureFunctions
• #SPFx
• Log issues & questions to the GitHub Repositories
Our Sponsors
GOLD
SILVERLOCATION
BRONZE
MEDIA
Thank you!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at

More Related Content

PPTX
SharePoint Framework, Angular and Azure Functions
PPTX
C# Async/Await Explained
PPTX
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
PDF
Marrying angular rails
PPTX
PowerShell Basics for Office Apps and Servers
PDF
AngularJS meets Rails
PDF
How angularjs saves rails
PDF
RailsAdmin - Overview and Best practices
SharePoint Framework, Angular and Azure Functions
C# Async/Await Explained
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
Marrying angular rails
PowerShell Basics for Office Apps and Servers
AngularJS meets Rails
How angularjs saves rails
RailsAdmin - Overview and Best practices

What's hot (20)

PPTX
Introduction to Angular 2
PDF
Quick Way to work with Models and Alloy in Appcelerator Titanium
PDF
Flexible UI Components for a Multi-Framework World
PPT
Angular js
PDF
An Intro to Angular 2
PDF
How to Use WebVR to Enhance the Web Experience
PDF
Smooth Animations for Web & Hybrid
PPTX
Advanced AngularJS Tips and Tricks
PPT
Integrating AngularJS with Drupal 7
PDF
Webrender 1.0
PPTX
Single Page Applications in SharePoint with Angular
PPTX
HTML5 Web Workers-unleashed
PPTX
Angular 4
PDF
Intro to Sails.js
PDF
RailsAdmin - the right way of doing data administration with Rails 3
PDF
Introduction to A-Frame
PDF
Introduction to Selenium and Ruby
PDF
Modern JavaScript, without giving up on Rails
PDF
Introduction to AJAX In WordPress
PDF
Drupal & AngularJS - DrupalCamp Spain 2014
Introduction to Angular 2
Quick Way to work with Models and Alloy in Appcelerator Titanium
Flexible UI Components for a Multi-Framework World
Angular js
An Intro to Angular 2
How to Use WebVR to Enhance the Web Experience
Smooth Animations for Web & Hybrid
Advanced AngularJS Tips and Tricks
Integrating AngularJS with Drupal 7
Webrender 1.0
Single Page Applications in SharePoint with Angular
HTML5 Web Workers-unleashed
Angular 4
Intro to Sails.js
RailsAdmin - the right way of doing data administration with Rails 3
Introduction to A-Frame
Introduction to Selenium and Ruby
Modern JavaScript, without giving up on Rails
Introduction to AJAX In WordPress
Drupal & AngularJS - DrupalCamp Spain 2014
Ad

Similar to SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Functions (20)

PPTX
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
PPTX
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
PPTX
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
PPTX
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
PPTX
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
PPTX
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
PPTX
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
PPTX
North American Collaboration Summit 2018 - SharePoint Framework, Angular and ...
PPTX
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
PPTX
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
PPTX
React or Angular and SharePoint Framework Development
PPTX
Angular vs React: Building modern SharePoint interfaces with SPFx
PPTX
Chris O'Brien - Introduction to the SharePoint Framework for developers
PDF
SPS Paris: Building great client-side web parts with spfx, pnp-js-core, React...
PDF
D1 - Building Great Client-side Web Parts with SPFx, PnP-JS-Core, ReactJS and...
PPTX
SharePoint Framework at a glance
PPTX
Making share point rock with angular and react
PDF
SPUnite17 Building Great Client Side Web Parts with SPFx
PPTX
Build Your First SharePoint Framework Webpart
PPTX
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
North American Collaboration Summit 2018 - SharePoint Framework, Angular and ...
North American Collaboration Summit 2018 - SharePoint Framework, Angular & Az...
SharePoint Saturday Utah 2018 - SharePoint Framework, Angular and Azure Funct...
React or Angular and SharePoint Framework Development
Angular vs React: Building modern SharePoint interfaces with SPFx
Chris O'Brien - Introduction to the SharePoint Framework for developers
SPS Paris: Building great client-side web parts with spfx, pnp-js-core, React...
D1 - Building Great Client-side Web Parts with SPFx, PnP-JS-Core, ReactJS and...
SharePoint Framework at a glance
Making share point rock with angular and react
SPUnite17 Building Great Client Side Web Parts with SPFx
Build Your First SharePoint Framework Webpart
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
Ad

More from Sébastien Levert (20)

PPTX
SharePoint Fest Chicago 2019 - Build a Full Intranet in 70 minutes
PPTX
SharePoint Fest Chicago 2019 - Building tailored search experiences in Modern...
PPTX
SharePoint Fest Chicago 2019 - From SharePoint to Office 365 Development
PPTX
ESPC19 - Supercharge Your Teams Experience with Advanced Development Techniques
PPTX
ESPC19 - Build Your First Microsoft Teams App Using SPFx
PPTX
SharePoint Fest Seattle 2019 - From SharePoint to Office 365 Development
PPTX
SharePoint Fest Seattle 2019 - Building tailored search experiences in Modern...
PPTX
SPC19 - Building tailored search experiences in Modern SharePoint
PPTX
SharePoint Fest 2019 - Build an intelligent application by connecting it to t...
PPTX
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
PPTX
SharePoint Fest DC 2019 - From SharePoint to Office 365 Development
PPTX
Webinar - 2020-03-24 - Build your first Microsoft Teams app using SPFx
PPTX
SPTechCon Austin 2019 - Top 10 feature trends to make you fall in love with y...
PPTX
SPTechCon Austin 2019 - From SharePoint to Office 365 development
PPTX
SharePoint Fest Chicago 2018 - From SharePoint to Office 365 development
PPTX
SharePoint Saturday Vienna 2018 - Top 10 feature trends to make you fall in l...
PPTX
SharePoint Saturday Vienna 2018 - Building a modern intranet in 60 minutes
PPTX
European SharePoint Conference 2018 - Build an intelligent application by con...
PPTX
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
PPTX
Nashville SharePoint User Group 2018 - Building a modern intranet in 60 minutes
SharePoint Fest Chicago 2019 - Build a Full Intranet in 70 minutes
SharePoint Fest Chicago 2019 - Building tailored search experiences in Modern...
SharePoint Fest Chicago 2019 - From SharePoint to Office 365 Development
ESPC19 - Supercharge Your Teams Experience with Advanced Development Techniques
ESPC19 - Build Your First Microsoft Teams App Using SPFx
SharePoint Fest Seattle 2019 - From SharePoint to Office 365 Development
SharePoint Fest Seattle 2019 - Building tailored search experiences in Modern...
SPC19 - Building tailored search experiences in Modern SharePoint
SharePoint Fest 2019 - Build an intelligent application by connecting it to t...
SharePoint Fest DC 2019 - Bot Framework and Microsoft Graph - Join The Revolu...
SharePoint Fest DC 2019 - From SharePoint to Office 365 Development
Webinar - 2020-03-24 - Build your first Microsoft Teams app using SPFx
SPTechCon Austin 2019 - Top 10 feature trends to make you fall in love with y...
SPTechCon Austin 2019 - From SharePoint to Office 365 development
SharePoint Fest Chicago 2018 - From SharePoint to Office 365 development
SharePoint Saturday Vienna 2018 - Top 10 feature trends to make you fall in l...
SharePoint Saturday Vienna 2018 - Building a modern intranet in 60 minutes
European SharePoint Conference 2018 - Build an intelligent application by con...
SharePoint Saturday Belgium 2018 - APIs, APIs everywhere!
Nashville SharePoint User Group 2018 - Building a modern intranet in 60 minutes

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Electronic commerce courselecture one. Pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
Modernizing your data center with Dell and AMD
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
NewMind AI Weekly Chronicles - August'25 Week I
Mobile App Security Testing_ A Comprehensive Guide.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Big Data Technologies - Introduction.pptx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Spectroscopy.pptx food analysis technology
NewMind AI Monthly Chronicles - July 2025
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Per capita expenditure prediction using model stacking based on satellite ima...
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
MYSQL Presentation for SQL database connectivity
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation

SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Functions

  • 1. SharePoint Framework, Angular and Azure Functions by Sébastien Levert
  • 3. Hi! I’m Seb! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
  • 7. Angular… But which version ? • Works well with Angular 1.6 • Works OK with Angular 2 • Works awesome with Angular 4 (Did you just say Angular 4!?) • Works even better with Angular 5 (NgElement to the rescue!)
  • 8. Is that even possible ? • Some are thinking it is mission impossible… But it is! And it’s much more simpler than you think. • You have the full power of Angular within you own SPFx webparts • Multiple webparts can exist in a page, including their own routing configuration
  • 11. Embedding an Element public render(): void { this.domElement.innerHTML = ` <hello-world name="${this.properties.name}"> </hello-world>`; }
  • 12. Routing const routes: Routes = [ { path: '', component: SitesComponent, children: [ { path: '', component: SitesHomeComponent }, { path: 'sites', children: [ { path: 'new', component: SitesFormComponent }, { path: ':id', component: SitesViewComponent } ]}, ]} ]; import { appRoutes } from "./app/app.routes" protected get routes(): any { return appRoutes; }
  • 13. Global Configurations import { ConfigurationService } from "./app/services/ConfigurationService"; ConfigurationService { provide: APP_INITIALIZER, useFactory: (configurationService: ConfigurationService) => () => configurationService.load({ functionUrl: this.properties.functionUrl, functionKey: this.properties.functionKey, description: this.properties.description, styles: styles }), deps: [ConfigurationService], multi: true }
  • 14. Mocking Data if (Environment.type === EnvironmentType.Local) { return [ { provide: SitesService, useClass: MockSitesService }, ]; } else if (Environment.type == EnvironmentType.SharePoint || Environment.type == EnvironmentType.ClassicSharePoint) { return [ { provide: SitesService, useClass: SitesService }, ]; }
  • 15. Mocking Data export class MockSitesService implements ISitesService { public createSite(siteInformation: ISiteCreationInformation): Observable<ISiteCreationResponse> { return Observable.of<ISiteCreationResponse>({ description: `${siteInformation.description} (Mocked)`, email: `${siteInformation.url}@mocked.onmicrosoft.com`, id: "00000000-0000-0000-0000-000000000000", title: `${siteInformation.title} (Mocked)`, url: `#${siteInformation.url}` }).delay(2000); } }
  • 17. Why Azure Functions ? • Cheap way to host any API in Azure • You can use your favorite language • Super cheap to run • Perfect companion for any Single Page Application or any JavaScript component
  • 18. Our scenario • Using the PnP PowerShell Cmdlets • Connecting to the Microsoft Graph and to an Azure AD Application • Creating a ModernTeam Site (in under 15 seconds) based on a set of parameters • Boom!
  • 20. The full scenario • Build a SharePoint Framework WebPart • Use Angular as our main Framework • Include 3 routes (Home, New Site and Site Information) • Use Azure Function as my backend provisioning API • Use the Office UI Fabric components
  • 21. What about the Office UI Fabric ? • Well…You have 2 choices : Build or Reuse • My choice ? Reuse ! • But Seb… It’s Angular, I can’t reuse what does not exist… • Well…The React components exist, just reuse them !
  • 22. Downsides • Can’t use the CLI to build new components and slow to compile • Can’t use AOT to reduce the bundle size • Lots of “hacks” in code that make this approach… • Clearly not SPCAF compliant!
  • 23. Lessons learned • Never use any class or ids from the DOM. Always use theViewChild attribute. • You can use html templates using the require() approach.Try to do that, React! • When you have a strong AngularJS background, it feels just a little bit weird to move to Angular, but you will get used to it!
  • 24. And… Should I use it in production? • As of today, this approach is the only approach that works. • Use it to experiment, to learn the SharePoint Framework and Angular altogether. • Will require a lot of maintenance with new versions of SPFx… In short, I would not go all in right now… But…
  • 29. Sharing is caring • Use hashtags to share your experience • #Office365Dev • #MicrosoftGraph • #AzureFunctions • #SPFx • Log issues & questions to the GitHub Repositories
  • 31. Thank you! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at