SlideShare a Scribd company logo
European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure Functions
SharePoint Framework, Angular &
Azure Functions
SÉBASTIEN LEVERT
VALO INTRANET, CANADA
Hi! I’m Seb!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at
AGENDA
European SharePoint Conference 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 5 (Angular 5!?)
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 web parts can exist in a page, including their
own routing configuration
https://github.com/sebastienlevert/spfx-angular-boilerplate
European SharePoint Conference 2017 - SharePoint Framework, Angular & 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 Modern Team Site (in under 15 seconds)
based on a set of parameters
Boom!
Make it happen
THE COMPLETE SCENARIO
Build a SharePoint Framework Web Part
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 the
ViewChild 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…
SharePoint & Angular Elements | Thursday @ 10h20
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
Thank you!
@sebastienlevert | http://sebastienlevert.com | Product Evangelist & Partner Manager at

More Related Content

PPTX
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
PPTX
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
PDF
The Tale of 2 CLIs - Ember-cli and Angular-cli
PPTX
PPTX
React Native - CirebonDev
PDF
Finding the sweet spot - blending the best of native and web
PDF
Webpack and angularjs
PPTX
MAUI Blazor - One App that runs everywhere
SharePoint Fest DC - SharePoint Framework, Angular and Azure Functions
SharePoint Saturday Vancouver - SharePoint Framework, Angular and Azure Funct...
The Tale of 2 CLIs - Ember-cli and Angular-cli
React Native - CirebonDev
Finding the sweet spot - blending the best of native and web
Webpack and angularjs
MAUI Blazor - One App that runs everywhere

What's hot (20)

PDF
Getting started with Angular CLI
PDF
Creating BananaJS with Angular 2, Angular CLI, and Material Design
PDF
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
PPTX
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
PDF
React Native in a nutshell
PDF
React Native - Getting Started
PPTX
Ionic framework
PDF
A Debugging Adventure: Journey through Ember.js Glue
PPTX
Angular Universal
PDF
A Tale of 3 CLIs - Angular 2, Ember, and React
PDF
Hybrid Apps, Ionic framework
PDF
Introduction to React Native & Rendering Charts / Graphs
PPTX
Angular2 + New Firebase in Action
PPTX
Hands on react native
PDF
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
PDF
Say hello world with angular 5
PDF
Intro to react native
PDF
Ryan Christiani I Heard React Was Good
PPTX
React or Angular and SharePoint Framework Development
Getting started with Angular CLI
Creating BananaJS with Angular 2, Angular CLI, and Material Design
Using Angular-CLI to Deploy an Angular 2 App Using Firebase in 30 Minutes
React Native - Unleash the power of React in your device - Eduard Tomàs - Cod...
React Native in a nutshell
React Native - Getting Started
Ionic framework
A Debugging Adventure: Journey through Ember.js Glue
Angular Universal
A Tale of 3 CLIs - Angular 2, Ember, and React
Hybrid Apps, Ionic framework
Introduction to React Native & Rendering Charts / Graphs
Angular2 + New Firebase in Action
Hands on react native
Creating an Angular 2 Angular CLI app in 15 Minutes Using MaterializeCSS & Fi...
Say hello world with angular 5
Intro to react native
Ryan Christiani I Heard React Was Good
React or Angular and SharePoint Framework Development
Ad

Similar to European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure Functions (20)

PPTX
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
PPTX
SharePoint Framework, Angular and Azure Functions
PPTX
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
PPTX
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
PPTX
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
PPTX
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
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
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
SharePoint Saturday Zurich 2017 - SharePoint Framework the new development way
PPTX
SharePoint Framework at a glance
PDF
SPUnite17 Building Great Client Side Web Parts with SPFx
PPTX
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
PPTX
SharePoint Framework tips and tricks
PPTX
Real World Add-in Development for Office365
PPTX
Making share point rock with angular and react
SharePoint Fest Seattle - SharePoint Framework, Angular & Azure Functions
SharePoint Framework, Angular and Azure Functions
European Collaboration Summit - SharePoint Framework Angular & Azure Functions
SharePoint Saturday Twin Cities - SharePoint Framework, Angular & Azure Funct...
SharePoint Saturday New York 2017 - SharePoint Framework, Angular and Azure F...
SharePoint Saturday Lisbon 2017 - SharePoint Framework, Angular & Azure Funct...
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...
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...
SharePoint Saturday Zurich 2017 - SharePoint Framework the new development way
SharePoint Framework at a glance
SPUnite17 Building Great Client Side Web Parts with SPFx
[Patel] SPFx: An ISV Insight into latest Microsoft's customization model
SharePoint Framework tips and tricks
Real World Add-in Development for Office365
Making share point rock with angular and react
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
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Cloud computing and distributed systems.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPT
Teaching material agriculture food technology
PDF
Modernizing your data center with Dell and AMD
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Digital-Transformation-Roadmap-for-Companies.pptx
Cloud computing and distributed systems.
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
A Presentation on Artificial Intelligence
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The AUB Centre for AI in Media Proposal.docx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Teaching material agriculture food technology
Modernizing your data center with Dell and AMD
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.

European SharePoint Conference 2017 - SharePoint Framework, Angular & Azure Functions