SlideShare a Scribd company logo
1 of 21
Roy Kim
@roykimtoronto
roykimtoronto@gmail.com
July 2015
SharePoint Hosted Add-in with
AngularJS and Bootstrap
A
g
e
n
d
a
 CoverPhotos App Requirements
 SharePoint Add-in design
 AngularJS and Bootstrap Design
 Commentary
Requirements
• Create, manage and display a photo rotating
banner with headlines and page links.
• As a content author, add an app part, add to any
web part page so that page visitors have a visual
headline of announcements or navigation links
• As a content manager, add/remove photos, text,
link and configurations settings.
Demo
SharePoint Add-in Hosting Options
SharePoint-hosted
• No C# server-side code-behind.
• Instances of app's client side files are
stored in an "hidden" sub site
• Own domain
• Design decision: Cover photos app is
simple UI display with no UI processing
and business logic that require high
CPU and memory usage.
SharePoint Design
Cover Photos App Web
CoverPhotos Library
Setting List
Content Types
Photo
Setting
Boostrap.css
App.css
Content
adminApp.js
Scripts
Default.aspx
settings.aspx
adminPhoto.aspx
Pages
setting
Photo 1
Photo 2
Photo N
Host Web
Cover Photos App Part
App Manifest
Visual Studio
Project
AngularJS
• AngularJS is a structural framework for dynamic single page
applications.
• Features:
• 2-way data binding: automatic sync between view (DOM) and
model (JS objects)
• Controller: the behavior and model behind the DOM
• Routing: navigating between views
• Dependency Injection: loosely coupled services that allows for
unit testing and apply separation of concerns principle.
• Built-in services: remote http communication, url management,
logging, localization, formatting data displayed, "jQuery", caching,
animation, form validation
AngularJS Alternatives
• KnockoutJS
Create rich, responsive display and editor user interfaces with a clean
underlying data model. Any time you have sections of UI that update
dynamically, KO can help you implement it more simply and maintainably.
• EmberJS
Build ambitiously large web applications that are competitive with native apps.
• BackboneJS
Give your JS App some Backbone with Models, Views, Collections, and
Events.
AngularJS vs Alternatives Interest
AngularJS has trending upward search interest than other frameworks
Bootstrap Front End Framework
Bootstrap is a front-end framework containing HTML/CSS/JS UI templates for
typography, forms, buttons, navigation, responsive design, tables, images,
progress bar, tool tips, drop downs.
www.getbootstrap.com
Visual Studio SharePoint
App Web
NuGet Packages
AngularJS
http://devgirl.org/2013/03/21/fun-with-angularjs/
AngularJS
https://docs.angularjs.org/tutorial/step_02
View (DOM)
adminApp.js
coverPhotoModel.
js
Default.aspx
setting.aspx
adminPhoto.aspx
Admin Controller
AdminPhoto
Controller
Setting Controller
R
o
u
t
i
n
g
SharePoint
Server API
$Scope
$Scope
$Scope
CoverPhoto
Service
Angular Design
JSOM
App Default.aspx
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<div ng-app="photoApp" ng-controller="AdminController" class="container">
<h2>Preview</h2>
<div id="slides">
<div class="slides_container">
{{Slides.userMessage}}
</div>
<a class="prev"><</a>
<a href="#" class="next">></a>
</div>
<br />
<a id='settingsNavLink' href="#/settings">Settings</a> |
<a id='adminphotosNavLink' href="#/adminphotos">Admin Photos</a>
<div class="view-animate-container">
<div ng-view class="view-animate"></div>
</div>
</div>
<!-- angular scripts -->
<script type="text/javascript" src="../Scripts/adminApp.js"></script>
</asp:Content>
SharePoint ASP
content control
Angular
root
element
Controller
expression and scope property
routing
routing
.controller('SettingsController', ['$routeParams', '$scope', function ($routeParams, $scope) {
$scope.settingsData = {};
var admin = {
save: function save() {.
$.when(_CPApp.UpdateSettings($scope.settingsData)).done(function () {
_CPApp.getCoverPhotosListDataFromAppPage();
}).fail(function (status) {
$.extend($scope.settingsData, _CPApp.Settings());
$scope.$apply();
});
}
}
$scope.save = admin.save;
$scope.Slides = { userMessage: '0' };
coverPhotosVM = new coverPhotosViewModel();
coverPhotosVM.listName = "CoverPhotos";
var options = { … };
var _CPApp = new CoverPhotosApp(options);
$.when(_CPApp.GetSettings()).done(function (status) {
_CPApp.getCoverPhotosListDataFromAppPage();
$.extend($scope.settingsData, _CPApp.Settings());
$scope.Slides = _CPApp.Slides();
$scope.$apply();
});
}])
Settings Controller
Controller
Scope property and behavior definition
Scope initialization / property data population
CoverPhotos
var camlQuery = new SP.CamlQuery();
photoListItems = photoList.getItems(camlQuery);
clientContext.load(photoListItems);
clientContext.executeQueryAsync(Function.createDelegate(self, self.onGetPhotosList),
Function.createDelegate(self, self.onListDataFailed));
self.onGetPhotosList = function (sender, args) {
var photoVM = {};
var listItemEnumerator = photoListItems.getEnumerator();
if (photoListItems.get_count() == 0) {
self.Slides.userMessage = "No photos available. Please upload photos.";
return;
}
else {
self.Slides.userMessage = ""; }
while (listItemEnumerator.moveNext()) {
var oListItem = listItemEnumerator.get_current();
photoVM = new photoModel();
photoVM.id = oListItem.get_id();
photoVM.name = oListItem.get_item('Title');
photoVM.fileRef = oListItem.get_item('FileRef');
Callback
Get Photos from library
Return self.Slides to
$scope
JSOM vs REST API
Comparison
JavaScript Object Model Intellisense assistance
Easier to create and update data
“Object-oriented”
Batch requests
REST API Easier to troubleshoot and debug with
browser and fiddler
Batch requests only in Office 365
Preference for JSOM for Cover Photos App
Final Thoughts
• AngularJS is a powerful framework with lots of features; but can a bit overkill
for small apps such as this Cover Photos App
• However, I would still learn and apply AngularJS for future projects as it is the
most popular SPA framework and will get easier to implement with more
experience.
• AngularJS indeed has a steep learning curve.
• Bootstrap is the most popular front end framework and is the current standard.
• AngularJS and Bootstrap are easy to leverage in SharePoint Add-ins and can
be leveraged similarly with even farm solutions in application pages and web
parts.
Questions?
Feel free to contact!
• @roykimtoronto
• roykimtoronto@gmail.com
• www.roykim.ca

More Related Content

What's hot

Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Fabio Franzini
 
SharePoint Framework - Developer Preview
SharePoint Framework - Developer PreviewSharePoint Framework - Developer Preview
SharePoint Framework - Developer PreviewSean McLellan
 
Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePointFabio Franzini
 
SharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cellsSharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cellsRandy Mullis
 
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01Sonja Madsen
 
SharePoint 2013 Branding
SharePoint 2013 BrandingSharePoint 2013 Branding
SharePoint 2013 BrandingKashif Imran
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templatesPaul Hunt
 
Introduction to JSLink in 2013
Introduction to JSLink in 2013Introduction to JSLink in 2013
Introduction to JSLink in 2013Sparkhound Inc.
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien
 
SharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishSharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishKanwal Khipple
 
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...European Collaboration Summit
 
O365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side RenderingO365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side RenderingRiwut Libinuko
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien
 
The A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThe A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThomas Daly
 
Style guide for share point 2013 branding
Style guide for share point 2013 brandingStyle guide for share point 2013 branding
Style guide for share point 2013 brandingVinod Dangudubiyyapu
 
Building SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJSBuilding SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJSSharePointInstitute
 
Sp2013 overview biwug
Sp2013 overview biwugSp2013 overview biwug
Sp2013 overview biwugBIWUG
 
Sviluppare app per office
Sviluppare app per officeSviluppare app per office
Sviluppare app per officeFabio Franzini
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris O'Brien
 
Branding Modern SharePoint
Branding Modern SharePointBranding Modern SharePoint
Branding Modern SharePointEric Overfield
 

What's hot (20)

Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...Come riprogettare le attuali farm solution di share point con il nuovo modell...
Come riprogettare le attuali farm solution di share point con il nuovo modell...
 
SharePoint Framework - Developer Preview
SharePoint Framework - Developer PreviewSharePoint Framework - Developer Preview
SharePoint Framework - Developer Preview
 
Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePoint
 
SharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cellsSharePoint 2013: Using Client-Side Rendering to color-code list cells
SharePoint 2013: Using Client-Side Rendering to color-code list cells
 
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01SharePoint Framework, React and Office UI SPS Paris 2016 - d01
SharePoint Framework, React and Office UI SPS Paris 2016 - d01
 
SharePoint 2013 Branding
SharePoint 2013 BrandingSharePoint 2013 Branding
SharePoint 2013 Branding
 
Using js link and display templates
Using js link and display templatesUsing js link and display templates
Using js link and display templates
 
Introduction to JSLink in 2013
Introduction to JSLink in 2013Introduction to JSLink in 2013
Introduction to JSLink in 2013
 
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - referenceChris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
 
SharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishSharePoint Branding From Start to Finish
SharePoint Branding From Start to Finish
 
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...
ECS 19 Bert Jansen - Taking your SharePoint to the next level – Transforming ...
 
O365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side RenderingO365 Saturday - Deepdive SharePoint Client Side Rendering
O365 Saturday - Deepdive SharePoint Client Side Rendering
 
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 appsChris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
 
The A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with BootstrapThe A to Z of Building a Responsive SharePoint Site with Bootstrap
The A to Z of Building a Responsive SharePoint Site with Bootstrap
 
Style guide for share point 2013 branding
Style guide for share point 2013 brandingStyle guide for share point 2013 branding
Style guide for share point 2013 branding
 
Building SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJSBuilding SharePoint Single Page Applications Using AngularJS
Building SharePoint Single Page Applications Using AngularJS
 
Sp2013 overview biwug
Sp2013 overview biwugSp2013 overview biwug
Sp2013 overview biwug
 
Sviluppare app per office
Sviluppare app per officeSviluppare app per office
Sviluppare app per office
 
Chris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office ProductsChris OBrien - Weaving Enterprise Solutions into Office Products
Chris OBrien - Weaving Enterprise Solutions into Office Products
 
Branding Modern SharePoint
Branding Modern SharePointBranding Modern SharePoint
Branding Modern SharePoint
 

Similar to SharePoint Hosted Add-in with AngularJS and Bootstrap

Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - IntroductionSenthil Kumar
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4Jon Galloway
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJSRajthilakMCA
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleAlexandre Marreiros
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember Chandra Sekar
 
A white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSA white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSOptiSol Business Solutions
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopDrew Morris
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Againjonknapp
 
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...OptiSol Business Solutions
 
Starting an AngularJS Project with Visual Studio
Starting an AngularJS Project with Visual StudioStarting an AngularJS Project with Visual Studio
Starting an AngularJS Project with Visual StudioIran Reyes Fleitas
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentationivpol
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJSEdureka!
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJSEdureka!
 

Similar to SharePoint Hosted Add-in with AngularJS and Bootstrap (20)

Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Python Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - AppenginePython Ireland Nov 2009 Talk - Appengine
Python Ireland Nov 2009 Talk - Appengine
 
SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4SoCal Code Camp 2011 - ASP.NET MVC 4
SoCal Code Camp 2011 - ASP.NET MVC 4
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Building a dashboard using AngularJS
Building a dashboard using AngularJSBuilding a dashboard using AngularJS
Building a dashboard using AngularJS
 
ASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a coupleASP.NEt MVC and Angular What a couple
ASP.NEt MVC and Angular What a couple
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Create an application with ember
Create an application with ember Create an application with ember
Create an application with ember
 
A white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JSA white paper on Fundamentals and Implementations of Angular JS
A white paper on Fundamentals and Implementations of Angular JS
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
 
From Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) AgainFrom Backbone to Ember and Back(bone) Again
From Backbone to Ember and Back(bone) Again
 
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...Fundamentals and Implementations of Angular JS with renowned Technology Platf...
Fundamentals and Implementations of Angular JS with renowned Technology Platf...
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
Starting an AngularJS Project with Visual Studio
Starting an AngularJS Project with Visual StudioStarting an AngularJS Project with Visual Studio
Starting an AngularJS Project with Visual Studio
 
ASP.NET MVC Presentation
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
 
Getting Started with AngularJS
Getting Started with AngularJSGetting Started with AngularJS
Getting Started with AngularJS
 
AngularJS
AngularJSAngularJS
AngularJS
 
Getting Started With AngularJS
Getting Started With AngularJSGetting Started With AngularJS
Getting Started With AngularJS
 

More from Roy Kim

Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Roy Kim
 
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGAzure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGRoy Kim
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentRoy Kim
 
Azure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration TestsAzure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration TestsRoy Kim
 
Applying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web AppsApplying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web AppsRoy Kim
 
Big Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI MobileBig Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI MobileRoy Kim
 
Design and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web AppsDesign and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web AppsRoy Kim
 
SharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid OverviewSharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid OverviewRoy Kim
 
Designing for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsRoy Kim
 
Microsoft Azure For Solutions Architects
Microsoft Azure For Solutions ArchitectsMicrosoft Azure For Solutions Architects
Microsoft Azure For Solutions ArchitectsRoy Kim
 
SharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimSharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimRoy Kim
 
Networking For Application Developers by Roy Kim
Networking For Application Developers by Roy KimNetworking For Application Developers by Roy Kim
Networking For Application Developers by Roy KimRoy Kim
 
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer FeatureSharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer FeatureRoy Kim
 

More from Roy Kim (13)

Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
Microsoft Reactor Toronto 5/5/2020 | Azure Kubernetes In Action - Running and...
 
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUGAzure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
Azure AD App Proxy Login Scenarios with an On Premises Applications - TSPUG
 
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template DeploymentAzure Key Vault with a PaaS Architecture and ARM Template Deployment
Azure Key Vault with a PaaS Architecture and ARM Template Deployment
 
Azure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration TestsAzure App Gateway and Log Analytics under Penetration Tests
Azure App Gateway and Log Analytics under Penetration Tests
 
Applying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web AppsApplying Advanced Techniques to Azure Web Apps
Applying Advanced Techniques to Azure Web Apps
 
Big Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI MobileBig Data Analytics from Azure Cloud to Power BI Mobile
Big Data Analytics from Azure Cloud to Power BI Mobile
 
Design and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web AppsDesign and Configure Azure App Service Web Apps
Design and Configure Azure App Service Web Apps
 
SharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid OverviewSharePoint 2016 Hybrid Overview
SharePoint 2016 Hybrid Overview
 
Designing for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted AppsDesigning for SharePoint Provider Hosted Apps
Designing for SharePoint Provider Hosted Apps
 
Microsoft Azure For Solutions Architects
Microsoft Azure For Solutions ArchitectsMicrosoft Azure For Solutions Architects
Microsoft Azure For Solutions Architects
 
SharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy KimSharePoint 2013 Hosted App Presentation by Roy Kim
SharePoint 2013 Hosted App Presentation by Roy Kim
 
Networking For Application Developers by Roy Kim
Networking For Application Developers by Roy KimNetworking For Application Developers by Roy Kim
Networking For Application Developers by Roy Kim
 
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer FeatureSharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
SharePoint Saturday 2010 - SharePoint 2010 Content Organizer Feature
 

Recently uploaded

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

SharePoint Hosted Add-in with AngularJS and Bootstrap

  • 1. Roy Kim @roykimtoronto roykimtoronto@gmail.com July 2015 SharePoint Hosted Add-in with AngularJS and Bootstrap
  • 2. A g e n d a  CoverPhotos App Requirements  SharePoint Add-in design  AngularJS and Bootstrap Design  Commentary
  • 3. Requirements • Create, manage and display a photo rotating banner with headlines and page links. • As a content author, add an app part, add to any web part page so that page visitors have a visual headline of announcements or navigation links • As a content manager, add/remove photos, text, link and configurations settings.
  • 5. SharePoint Add-in Hosting Options SharePoint-hosted • No C# server-side code-behind. • Instances of app's client side files are stored in an "hidden" sub site • Own domain • Design decision: Cover photos app is simple UI display with no UI processing and business logic that require high CPU and memory usage.
  • 6. SharePoint Design Cover Photos App Web CoverPhotos Library Setting List Content Types Photo Setting Boostrap.css App.css Content adminApp.js Scripts Default.aspx settings.aspx adminPhoto.aspx Pages setting Photo 1 Photo 2 Photo N Host Web Cover Photos App Part App Manifest
  • 8. AngularJS • AngularJS is a structural framework for dynamic single page applications. • Features: • 2-way data binding: automatic sync between view (DOM) and model (JS objects) • Controller: the behavior and model behind the DOM • Routing: navigating between views • Dependency Injection: loosely coupled services that allows for unit testing and apply separation of concerns principle. • Built-in services: remote http communication, url management, logging, localization, formatting data displayed, "jQuery", caching, animation, form validation
  • 9. AngularJS Alternatives • KnockoutJS Create rich, responsive display and editor user interfaces with a clean underlying data model. Any time you have sections of UI that update dynamically, KO can help you implement it more simply and maintainably. • EmberJS Build ambitiously large web applications that are competitive with native apps. • BackboneJS Give your JS App some Backbone with Models, Views, Collections, and Events.
  • 10. AngularJS vs Alternatives Interest AngularJS has trending upward search interest than other frameworks
  • 11. Bootstrap Front End Framework Bootstrap is a front-end framework containing HTML/CSS/JS UI templates for typography, forms, buttons, navigation, responsive design, tables, images, progress bar, tool tips, drop downs. www.getbootstrap.com
  • 12. Visual Studio SharePoint App Web NuGet Packages
  • 15. View (DOM) adminApp.js coverPhotoModel. js Default.aspx setting.aspx adminPhoto.aspx Admin Controller AdminPhoto Controller Setting Controller R o u t i n g SharePoint Server API $Scope $Scope $Scope CoverPhoto Service Angular Design JSOM
  • 16. App Default.aspx <asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" runat="server"> <div ng-app="photoApp" ng-controller="AdminController" class="container"> <h2>Preview</h2> <div id="slides"> <div class="slides_container"> {{Slides.userMessage}} </div> <a class="prev"><</a> <a href="#" class="next">></a> </div> <br /> <a id='settingsNavLink' href="#/settings">Settings</a> | <a id='adminphotosNavLink' href="#/adminphotos">Admin Photos</a> <div class="view-animate-container"> <div ng-view class="view-animate"></div> </div> </div> <!-- angular scripts --> <script type="text/javascript" src="../Scripts/adminApp.js"></script> </asp:Content> SharePoint ASP content control Angular root element Controller expression and scope property routing routing
  • 17. .controller('SettingsController', ['$routeParams', '$scope', function ($routeParams, $scope) { $scope.settingsData = {}; var admin = { save: function save() {. $.when(_CPApp.UpdateSettings($scope.settingsData)).done(function () { _CPApp.getCoverPhotosListDataFromAppPage(); }).fail(function (status) { $.extend($scope.settingsData, _CPApp.Settings()); $scope.$apply(); }); } } $scope.save = admin.save; $scope.Slides = { userMessage: '0' }; coverPhotosVM = new coverPhotosViewModel(); coverPhotosVM.listName = "CoverPhotos"; var options = { … }; var _CPApp = new CoverPhotosApp(options); $.when(_CPApp.GetSettings()).done(function (status) { _CPApp.getCoverPhotosListDataFromAppPage(); $.extend($scope.settingsData, _CPApp.Settings()); $scope.Slides = _CPApp.Slides(); $scope.$apply(); }); }]) Settings Controller Controller Scope property and behavior definition Scope initialization / property data population
  • 18. CoverPhotos var camlQuery = new SP.CamlQuery(); photoListItems = photoList.getItems(camlQuery); clientContext.load(photoListItems); clientContext.executeQueryAsync(Function.createDelegate(self, self.onGetPhotosList), Function.createDelegate(self, self.onListDataFailed)); self.onGetPhotosList = function (sender, args) { var photoVM = {}; var listItemEnumerator = photoListItems.getEnumerator(); if (photoListItems.get_count() == 0) { self.Slides.userMessage = "No photos available. Please upload photos."; return; } else { self.Slides.userMessage = ""; } while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); photoVM = new photoModel(); photoVM.id = oListItem.get_id(); photoVM.name = oListItem.get_item('Title'); photoVM.fileRef = oListItem.get_item('FileRef'); Callback Get Photos from library Return self.Slides to $scope
  • 19. JSOM vs REST API Comparison JavaScript Object Model Intellisense assistance Easier to create and update data “Object-oriented” Batch requests REST API Easier to troubleshoot and debug with browser and fiddler Batch requests only in Office 365 Preference for JSOM for Cover Photos App
  • 20. Final Thoughts • AngularJS is a powerful framework with lots of features; but can a bit overkill for small apps such as this Cover Photos App • However, I would still learn and apply AngularJS for future projects as it is the most popular SPA framework and will get easier to implement with more experience. • AngularJS indeed has a steep learning curve. • Bootstrap is the most popular front end framework and is the current standard. • AngularJS and Bootstrap are easy to leverage in SharePoint Add-ins and can be leveraged similarly with even farm solutions in application pages and web parts.
  • 21. Questions? Feel free to contact! • @roykimtoronto • roykimtoronto@gmail.com • www.roykim.ca