SlideShare a Scribd company logo
SharePoint Framework, Angular
and Azure Functions
The modern developer toolbelt
Sébastien Levert
Hi! I’m Seb!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
Agenda
SharePoint Framework, Angular and 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!?)
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
https://github.com/sebastienlevert/spfx-angular-boilerplate
SharePoint Framework, Angular and Azure Functions
Dynamic Bootstrapping
protected get rootComponentType(): any {
return AppComponent;
}
protected get appDeclarationTypes(): any {
return [
DialogComponent, SitesComponent, SitesHomeComponent,
SitesFormComponent, SitesViewComponent
];
}
Dynamic Bootstrapping
private _bootStrapModule(): void {
var self = this;
platformBrowserDynamic().bootstrapModule(self._getModule()).then(
ngModuleRef => {
self._component = self._app['_rootComponents'][0]['_component’];
self.updateChanges();
self._zone.run(() => { console.log('Outside Done!'); });
}, err => {
console.log(err);
}
);
}
Dynamic Bootstrapping
const AppModule1 = Reflect.decorate([
NgModule({
imports: [BrowserModule, FormsModule, HttpModule, routes],
declarations: declarations,
bootstrap: [component],
exports: [RouterModule],
providers: providers
}),
Reflect.metadata('design:paramtypes', [ApplicationRef, NgZone])
], AppModule);
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/sebastienlevert/spfx-angular-samples
Sharing is caring
• Use hashtags to share your experience
• #Office365Dev
• #MicrosoftGraph
• #AzureFunctions
• #SPFx
• Log issues & questions to the GitHub Repositories
SharePoint Framework, Angular and Azure Functions
Thank you!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at

More Related Content

PPTX
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
PPTX
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
PPTX
C# Async/Await Explained
PDF
Orgchart for Alfresco lightning talk
PDF
How angularjs saves rails
PDF
AngularJS meets Rails
PDF
RailsAdmin - Overview and Best practices
PDF
Using JHipster for generating Angular/Spring Boot apps
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
C# Async/Await Explained
Orgchart for Alfresco lightning talk
How angularjs saves rails
AngularJS meets Rails
RailsAdmin - Overview and Best practices
Using JHipster for generating Angular/Spring Boot apps

What's hot (20)

PDF
Marrying angular rails
PPT
Angular js
PDF
Reactive Thinking in Java with RxJava2
PPTX
Introduction to Angular 2
PDF
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
PDF
Angular 2 Essential Training
PDF
Using JHipster for generating Angular/Spring Boot apps
PPTX
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
PPTX
EmberJS BucharestJS
PDF
An Intro to Angular 2
PDF
Appcelerator Titanium Alloy
PPTX
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
PPTX
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
PPTX
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
PPT
Angular js
PPT
Story ofcorespring infodeck
PDF
Tales of an open source library
PPTX
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
PPTX
Brief Introduction to Ember
PPTX
Single Page Applications in SharePoint with Angular
Marrying angular rails
Angular js
Reactive Thinking in Java with RxJava2
Introduction to Angular 2
Appcelerator Titanium Alloy + Kinvey Collection Databinding - Part One
Angular 2 Essential Training
Using JHipster for generating Angular/Spring Boot apps
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
EmberJS BucharestJS
An Intro to Angular 2
Appcelerator Titanium Alloy
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
Angular js
Story ofcorespring infodeck
Tales of an open source library
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure F...
Brief Introduction to Ember
Single Page Applications in SharePoint with Angular
Ad

Similar to SharePoint Framework, Angular and Azure Functions (20)

PPTX
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
PPTX
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
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
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
Chris O'Brien - Introduction to the SharePoint Framework for developers
PPTX
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
PDF
SPUnite17 Building Great Client Side Web Parts with SPFx
PPTX
Build Your First SharePoint Framework Webpart
PPTX
SharePoint Framework at a glance
PPTX
Making share point rock with angular and react
PDF
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
PPTX
SharePoint Framework tips and tricks
PPTX
German introduction to sp framework
PPTX
Learn from my Mistakes - Building Better Solutions in SPFx
PDF
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Fest Chicago 2017 - SharePoint Framework, Angular & Azure Functions
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
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...
Chris O'Brien - Introduction to the SharePoint Framework for developers
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
SPUnite17 Building Great Client Side Web Parts with SPFx
Build Your First SharePoint Framework Webpart
SharePoint Framework at a glance
Making share point rock with angular and react
How to convert your Full Trust Solutions to the SharePoint Framework (SPFx)
SharePoint Framework tips and tricks
German introduction to sp framework
Learn from my Mistakes - Building Better Solutions in SPFx
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
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)

PPTX
Big Data Technologies - Introduction.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
Newfamily of error-correcting codes based on genetic algorithms
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PDF
Omni-Path Integration Expertise Offered by Nor-Tech
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Cloud computing and distributed systems.
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
Big Data Technologies - Introduction.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
“AI and Expert System Decision Support & Business Intelligence Systems”
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
Newfamily of error-correcting codes based on genetic algorithms
NewMind AI Weekly Chronicles - August'25 Week I
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Modernizing your data center with Dell and AMD
MYSQL Presentation for SQL database connectivity
Review of recent advances in non-invasive hemoglobin estimation
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
Omni-Path Integration Expertise Offered by Nor-Tech
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
NewMind AI Monthly Chronicles - July 2025
GamePlan Trading System Review: Professional Trader's Honest Take
Cloud computing and distributed systems.
Sensors and Actuators in IoT Systems using pdf
Transforming Manufacturing operations through Intelligent Integrations

SharePoint Framework, Angular and Azure Functions

  • 1. SharePoint Framework, Angular and Azure Functions The modern developer toolbelt Sébastien Levert
  • 2. Hi! I’m Seb! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
  • 6. 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!?)
  • 7. 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
  • 10. Dynamic Bootstrapping protected get rootComponentType(): any { return AppComponent; } protected get appDeclarationTypes(): any { return [ DialogComponent, SitesComponent, SitesHomeComponent, SitesFormComponent, SitesViewComponent ]; }
  • 11. Dynamic Bootstrapping private _bootStrapModule(): void { var self = this; platformBrowserDynamic().bootstrapModule(self._getModule()).then( ngModuleRef => { self._component = self._app['_rootComponents'][0]['_component’]; self.updateChanges(); self._zone.run(() => { console.log('Outside Done!'); }); }, err => { console.log(err); } ); }
  • 12. Dynamic Bootstrapping const AppModule1 = Reflect.decorate([ NgModule({ imports: [BrowserModule, FormsModule, HttpModule, routes], declarations: declarations, bootstrap: [component], exports: [RouterModule], providers: providers }), Reflect.metadata('design:paramtypes', [ApplicationRef, NgZone]) ], AppModule);
  • 13. 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; }
  • 14. 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 }
  • 15. 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 }, ]; }
  • 16. 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); } }
  • 18. 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
  • 19. 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!
  • 21. 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
  • 22. 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 !
  • 23. 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!
  • 24. 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!
  • 25. 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…
  • 30. Sharing is caring • Use hashtags to share your experience • #Office365Dev • #MicrosoftGraph • #AzureFunctions • #SPFx • Log issues & questions to the GitHub Repositories
  • 32. Thank you! @sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at