SlideShare a Scribd company logo
1 of 20
BUILDING SHAREPOINT
SINGLE PAGE APPLICATIONS
USING ANGULARJS
STEVE PIETREK (@SPIETREK)
HTTPS://GITHUB.COM/SPIETREK/
STEVE PIETREK
Cardinal Solutions Group
App Dev Practice Manager
SharePoint Application Architect
Front End Developer
Raleigh/Durham
Contact
@spietrek
spietrek@cardinalsolutions.com
Presentation References
https://github.com/spietrek/
AGENDA
• SPA OVERVIEW
• ANGULARJS OVERVIEW
• TOOLS, LIFECYCLE MANAGEMENT, & DATA ACCESS
• PROJECTS DEMO
• DEPLOYMENT
• BEST PRACTICES & GOTCHAS
SINGLE PAGE APPLICATIONS
SINGLE PAGE APPLICATIONS
• GOAL:
• PROVIDE A DESKTOP-LIKE RICH USER EXPERIENCE
• ATTRIBUTES:
• ENTIRE SITE CONTENT LOADS WITHIN A SINGLE HTML PAGE
• ONLY AREAS OF THE SITE WILL RELOAD BASED ON USER ACTIONS. NO URL CHANGE EXCEPT
FOR HASH (#).
• STATE MAINTAINED ON CLIENT
• PRESENTATION LAYER CAN BE COMPLETELY DECOUPLED FROM BACKEND LAYER
• MAIN TECHNOLOGIES: HTML, CSS, JAVASCRIPT, AJAX, WEB SERVICES (E.G. REST)
• BENEFITS:
• PERFORMANCE
• MAINTAINABILITY
• CODE REUSE
• QUICK DEPLOYMENTS
Not Cloud Ready
Performance and
Stability
Lifecycle
Management Resources
"TRADITIONAL" SHAREPOINT DEVELOPMENT
CHALLENGES
ANGULARJS OVERVIEW
WHAT'S ANGULARJS?
• "SUPERHEROIC JAVASCRIPT MVW FRAMEWORK"
• STRUCTURAL JAVASCRIPT CLIENT-SIDE FRAMEWORK FOR BUILDING DYNAMIC
WEB APPS (USING HTML AND JAVASCRIPT)
• EMPOWERS TRADITIONAL HTML
• EXTEND HTML'S SYNTAX
• BACKED BY GOOGLE AND THE COMMUNITY
• OPEN SOURCE (MIT LICENSE)
• VIBRANT COMMUNITY (BOOKS, STACK OVERFLOW, BLOGS, PLUG-INS,
RESOURCES, ETC.)
• ** GREAT FRAMEWORK FOR BUILDING SINGLE PAGE APPLICATIONS
** My opinion
MAIN FEATURES OF ANGULARJS
Two-way
Data Binding
MV*
Dependency
Injection
Testing
jqLite or
jQuery
Templates Modules Controllers Filters Providers
Directives Routing
Form
Validation
IMPLEMENTATION OF MV* IN ANGULARJS
Controller
(Logic/
Behaviors)View
(UI)
DOM
Browser
RESTful
Web
Service
Model
(Provider)
User Interaction (Routes & Behaviors)
$scope
ANGULARJS DEMO
HTTPS://JSFIDDLE.NET/SPIETREK/04Y3ZWO8/3/
TOOLS AND DATA ACCESS
TOOLS AND LIFECYCLE MANAGEMENT
• IDE: VISUAL STUDIO, VISUAL STUDIO CODE, WEBSTORM, BRACKETS, ATOM, SUBLIME
TEXT
• THIRD-PARTY JAVASCRIPT FRAMEWORKS: JQUERY, BOOTSTRAP, MOMENT,
GLOBALIZE, DATATABLES, NG-TASTY, FONT AWESOME, SPSERVICES,
LODASH/UNDERSCORE
• BROWSER PLUG-INS: FIREBUG, BATARANG, POSTMAN
• TASK RUNNER: GULP
• MODULAR BUNDLER: WEBPACK
• PACKAGE MANAGER: NPM, BOWER
• SOURCE CONTROL: GIT, GITHUB, BITBUCKET, VISUAL STUDIO ONLINE
• TESTING: KARMA, MOCHA, JASMINE, PHANTOMJS
• OTHER TOOLS: NODE.JS, FIDDLER
SHAREPOINT 2013 REST API
• USE JQUERY AJAX OR ANGULARJS $HTTP
• OPTIONS
• $SELECT
• $FILTER
• $TOP
• $SKIP
• $ORDERBY
• $EXPAND
• BEST PRACTICES
• USE POSTMAN OR FIDDLER TO EXECUTE AND TEST QUERIES
• SET THE ACCEPT HEADER
• ONLY RETRIEVE WHAT YOU NEED BY USING $SELECT AND $FILTER.
• “CHUNKY, NOT CHATTY”
PROJECTS DEMO
DEPLOYMENT
DEPLOYMENT WORKFLOW
Create Custom Page Layout
•Enable Publishing features
•Style and script references
•Base HTML referencing ng-app
•Upload to Master Page Gallery
•Create page using custom page layout
Local Test
•Gulp tasks (test, serve-dev, serve-specs)
•Disable web security (--disable-web-
security) errors in Chrome
•Functional testing in Chrome
SharePoint Deployment
•Gulp task (build)
•Same folder structure as local environment
•Upload source code
•Functional testing in SharePoint
BEST PRACTICES & GOTCHAS
BEST PRACTICES
• ORGANIZE CODE: JOHN PAPA’S ANGULAR STYLE GUIDE HTTP://GOO.GL/XLJMI6
• GROUP BY FEATURE (PROJECTS, FORM, ADMIN), NOT COMPONENT TYPE (E.G.
CONTROLLER, DIRECTIVE, PROVIDER)
• NAME YOUR FILES BY FUNCTION (E.G. PROJECTS, DASHBOARD, ADMIN)
• GROUP ALL FILES TOGETHER (MODULE, CONTROLLERS, SERVICES, DIRECTIVES, UNIT
TESTS, END-TO-END TESTS)
• ONLY ONE CONTROLLER PER VIEW. SHARE DATA BETWEEN CONTROLLERS USING
SERVICES.
• BUILD AND DEPLOY OFTEN!!!
• LEARN GIT
• WRITE UNIT TESTS
• TEST IN DIFFERENT BROWSERS
GOTCHAS
Issue Workaround
SharePoint Item-limit Threshold • Split data into separate lists or libraries.
• Add indexes to columns where you want to filter.
SharePoint Security • Apply security at the site or list levels.
• If possible, avoid item-level permissions.
• Use Search API to aggregate across sites and lists.
CSS Overrides • SharePoint default CSS may cause style issues.
• Deploy to SharePoint and test using different browsers.
• Update CSS to run the same in local environment.
AngularJS Controller Bloat • Use directives to manipulate DOM.
• Data should be stored in services.
AngularJS Performance • Avoid 2000 watchers on page (higher in 1.3+).
• Use Batarang to search for duplication.
• Use bind once for expressions which do not change.
Dependencies • Review dependencies whenever upgrading tools (npm &
bower).
Frameworks • "Framework of the week"

More Related Content

What's hot

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
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien
 
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 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIsJohn Calvert
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web AppsKranthi Lakum
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointMark Rackley
 
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
 
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
 
Deep-dive building solutions on the SharePoint Framework
Deep-dive building solutions on the SharePoint FrameworkDeep-dive building solutions on the SharePoint Framework
Deep-dive building solutions on the SharePoint FrameworkWaldek Mastykarz
 
Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePointFabio Franzini
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web partsRandy Williams
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure FunctionsJeremy Likness
 
A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)Gustaf Nilsson Kotte
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talkDaiwei Lu
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConSPTechCon
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopMark Rackley
 
Going Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETGoing Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETJeremy Likness
 

What's hot (20)

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
 
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
Chris O'Brien - Customizing the SharePoint/Office 365 UI with JavaScript (ESP...
 
Chris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developersChris O'Brien - Introduction to the SharePoint Framework for developers
Chris O'Brien - Introduction to the SharePoint Framework for developers
 
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 APIs
SharePoint 2013 APIsSharePoint 2013 APIs
SharePoint 2013 APIs
 
Progressive Web Apps
Progressive Web AppsProgressive Web Apps
Progressive Web Apps
 
SPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePointSPTechCon 2014 How to develop and debug client side code in SharePoint
SPTechCon 2014 How to develop and debug client side code in SharePoint
 
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...
 
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 ...
 
Apex & jQuery Mobile
Apex & jQuery MobileApex & jQuery Mobile
Apex & jQuery Mobile
 
Deep-dive building solutions on the SharePoint Framework
Deep-dive building solutions on the SharePoint FrameworkDeep-dive building solutions on the SharePoint Framework
Deep-dive building solutions on the SharePoint Framework
 
Single page applications & SharePoint
Single page applications & SharePointSingle page applications & SharePoint
Single page applications & SharePoint
 
Spicing up SharePoint web parts
Spicing up SharePoint web partsSpicing up SharePoint web parts
Spicing up SharePoint web parts
 
Code First with Serverless Azure Functions
Code First with Serverless Azure FunctionsCode First with Serverless Azure Functions
Code First with Serverless Azure Functions
 
A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)A Simpler Web App Architecture (jDays 2016)
A Simpler Web App Architecture (jDays 2016)
 
Server rendering-talk
Server rendering-talkServer rendering-talk
Server rendering-talk
 
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechConDeep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
Deep Dive into the Content Query Web Part by Christina Wheeler - SPTechCon
 
Introduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint WorkshopIntroduction to Client Side Dev in SharePoint Workshop
Introduction to Client Side Dev in SharePoint Workshop
 
Going Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NETGoing Serverless with Azure Functions in .NET
Going Serverless with Azure Functions in .NET
 
Html5 histroy api
Html5 histroy apiHtml5 histroy api
Html5 histroy api
 

Similar to Building SharePoint Single Page Applications Using AngularJS

Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksFITC
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Jeremy Likness
 
Building high performance and scalable share point applications
Building high performance and scalable share point applicationsBuilding high performance and scalable share point applications
Building high performance and scalable share point applicationsTalbott Crowell
 
The 3 Top Techniques for Web Security Testing Using a Proxy
The 3 Top Techniques for Web Security Testing Using a ProxyThe 3 Top Techniques for Web Security Testing Using a Proxy
The 3 Top Techniques for Web Security Testing Using a ProxyTEST Huddle
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page appsThomas Heymann
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache UsergridDavid M. Johnson
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesBoyan Borisov
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesTeamstudio
 
Eclipse Dirigible WebIDE - Deep Dive
Eclipse Dirigible WebIDE - Deep DiveEclipse Dirigible WebIDE - Deep Dive
Eclipse Dirigible WebIDE - Deep DiveNedelcho Delchev
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An IntroductionMatthias Güntert
 
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol ValidationBIOVIA
 
Publishing API documentation -- Workshop
Publishing API documentation -- WorkshopPublishing API documentation -- Workshop
Publishing API documentation -- WorkshopTom Johnson
 

Similar to Building SharePoint Single Page Applications Using AngularJS (20)

Building Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript FrameworksBuilding Enterprise Grade Front-End Applications with JavaScript Frameworks
Building Enterprise Grade Front-End Applications with JavaScript Frameworks
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Building high performance and scalable share point applications
Building high performance and scalable share point applicationsBuilding high performance and scalable share point applications
Building high performance and scalable share point applications
 
uMobile Development Strategies
uMobile Development StrategiesuMobile Development Strategies
uMobile Development Strategies
 
The 3 Top Techniques for Web Security Testing Using a Proxy
The 3 Top Techniques for Web Security Testing Using a ProxyThe 3 Top Techniques for Web Security Testing Using a Proxy
The 3 Top Techniques for Web Security Testing Using a Proxy
 
Server and client rendering of single page apps
Server and client rendering of single page appsServer and client rendering of single page apps
Server and client rendering of single page apps
 
How to Contribute to Apache Usergrid
How to Contribute to Apache UsergridHow to Contribute to Apache Usergrid
How to Contribute to Apache Usergrid
 
Node.js
Node.jsNode.js
Node.js
 
Large Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the ScenesLarge Scale Drupal - Behind the Scenes
Large Scale Drupal - Behind the Scenes
 
Optimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best PracticesOptimus XPages: An Explosion of Techniques and Best Practices
Optimus XPages: An Explosion of Techniques and Best Practices
 
Eclipse Dirigible WebIDE - Deep Dive
Eclipse Dirigible WebIDE - Deep DiveEclipse Dirigible WebIDE - Deep Dive
Eclipse Dirigible WebIDE - Deep Dive
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
Azure Application insights - An Introduction
Azure Application insights - An IntroductionAzure Application insights - An Introduction
Azure Application insights - An Introduction
 
Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
 
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
(ATS6-PLAT02) Accelrys Catalog and Protocol Validation
 
Publishing API documentation -- Workshop
Publishing API documentation -- WorkshopPublishing API documentation -- Workshop
Publishing API documentation -- Workshop
 

Recently uploaded

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
🐬 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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
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
 

Recently uploaded (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
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
 

Building SharePoint Single Page Applications Using AngularJS

  • 1. BUILDING SHAREPOINT SINGLE PAGE APPLICATIONS USING ANGULARJS STEVE PIETREK (@SPIETREK) HTTPS://GITHUB.COM/SPIETREK/
  • 2. STEVE PIETREK Cardinal Solutions Group App Dev Practice Manager SharePoint Application Architect Front End Developer Raleigh/Durham Contact @spietrek spietrek@cardinalsolutions.com Presentation References https://github.com/spietrek/
  • 3. AGENDA • SPA OVERVIEW • ANGULARJS OVERVIEW • TOOLS, LIFECYCLE MANAGEMENT, & DATA ACCESS • PROJECTS DEMO • DEPLOYMENT • BEST PRACTICES & GOTCHAS
  • 5. SINGLE PAGE APPLICATIONS • GOAL: • PROVIDE A DESKTOP-LIKE RICH USER EXPERIENCE • ATTRIBUTES: • ENTIRE SITE CONTENT LOADS WITHIN A SINGLE HTML PAGE • ONLY AREAS OF THE SITE WILL RELOAD BASED ON USER ACTIONS. NO URL CHANGE EXCEPT FOR HASH (#). • STATE MAINTAINED ON CLIENT • PRESENTATION LAYER CAN BE COMPLETELY DECOUPLED FROM BACKEND LAYER • MAIN TECHNOLOGIES: HTML, CSS, JAVASCRIPT, AJAX, WEB SERVICES (E.G. REST) • BENEFITS: • PERFORMANCE • MAINTAINABILITY • CODE REUSE • QUICK DEPLOYMENTS
  • 6. Not Cloud Ready Performance and Stability Lifecycle Management Resources "TRADITIONAL" SHAREPOINT DEVELOPMENT CHALLENGES
  • 8. WHAT'S ANGULARJS? • "SUPERHEROIC JAVASCRIPT MVW FRAMEWORK" • STRUCTURAL JAVASCRIPT CLIENT-SIDE FRAMEWORK FOR BUILDING DYNAMIC WEB APPS (USING HTML AND JAVASCRIPT) • EMPOWERS TRADITIONAL HTML • EXTEND HTML'S SYNTAX • BACKED BY GOOGLE AND THE COMMUNITY • OPEN SOURCE (MIT LICENSE) • VIBRANT COMMUNITY (BOOKS, STACK OVERFLOW, BLOGS, PLUG-INS, RESOURCES, ETC.) • ** GREAT FRAMEWORK FOR BUILDING SINGLE PAGE APPLICATIONS ** My opinion
  • 9. MAIN FEATURES OF ANGULARJS Two-way Data Binding MV* Dependency Injection Testing jqLite or jQuery Templates Modules Controllers Filters Providers Directives Routing Form Validation
  • 10. IMPLEMENTATION OF MV* IN ANGULARJS Controller (Logic/ Behaviors)View (UI) DOM Browser RESTful Web Service Model (Provider) User Interaction (Routes & Behaviors) $scope
  • 12. TOOLS AND DATA ACCESS
  • 13. TOOLS AND LIFECYCLE MANAGEMENT • IDE: VISUAL STUDIO, VISUAL STUDIO CODE, WEBSTORM, BRACKETS, ATOM, SUBLIME TEXT • THIRD-PARTY JAVASCRIPT FRAMEWORKS: JQUERY, BOOTSTRAP, MOMENT, GLOBALIZE, DATATABLES, NG-TASTY, FONT AWESOME, SPSERVICES, LODASH/UNDERSCORE • BROWSER PLUG-INS: FIREBUG, BATARANG, POSTMAN • TASK RUNNER: GULP • MODULAR BUNDLER: WEBPACK • PACKAGE MANAGER: NPM, BOWER • SOURCE CONTROL: GIT, GITHUB, BITBUCKET, VISUAL STUDIO ONLINE • TESTING: KARMA, MOCHA, JASMINE, PHANTOMJS • OTHER TOOLS: NODE.JS, FIDDLER
  • 14. SHAREPOINT 2013 REST API • USE JQUERY AJAX OR ANGULARJS $HTTP • OPTIONS • $SELECT • $FILTER • $TOP • $SKIP • $ORDERBY • $EXPAND • BEST PRACTICES • USE POSTMAN OR FIDDLER TO EXECUTE AND TEST QUERIES • SET THE ACCEPT HEADER • ONLY RETRIEVE WHAT YOU NEED BY USING $SELECT AND $FILTER. • “CHUNKY, NOT CHATTY”
  • 17. DEPLOYMENT WORKFLOW Create Custom Page Layout •Enable Publishing features •Style and script references •Base HTML referencing ng-app •Upload to Master Page Gallery •Create page using custom page layout Local Test •Gulp tasks (test, serve-dev, serve-specs) •Disable web security (--disable-web- security) errors in Chrome •Functional testing in Chrome SharePoint Deployment •Gulp task (build) •Same folder structure as local environment •Upload source code •Functional testing in SharePoint
  • 18. BEST PRACTICES & GOTCHAS
  • 19. BEST PRACTICES • ORGANIZE CODE: JOHN PAPA’S ANGULAR STYLE GUIDE HTTP://GOO.GL/XLJMI6 • GROUP BY FEATURE (PROJECTS, FORM, ADMIN), NOT COMPONENT TYPE (E.G. CONTROLLER, DIRECTIVE, PROVIDER) • NAME YOUR FILES BY FUNCTION (E.G. PROJECTS, DASHBOARD, ADMIN) • GROUP ALL FILES TOGETHER (MODULE, CONTROLLERS, SERVICES, DIRECTIVES, UNIT TESTS, END-TO-END TESTS) • ONLY ONE CONTROLLER PER VIEW. SHARE DATA BETWEEN CONTROLLERS USING SERVICES. • BUILD AND DEPLOY OFTEN!!! • LEARN GIT • WRITE UNIT TESTS • TEST IN DIFFERENT BROWSERS
  • 20. GOTCHAS Issue Workaround SharePoint Item-limit Threshold • Split data into separate lists or libraries. • Add indexes to columns where you want to filter. SharePoint Security • Apply security at the site or list levels. • If possible, avoid item-level permissions. • Use Search API to aggregate across sites and lists. CSS Overrides • SharePoint default CSS may cause style issues. • Deploy to SharePoint and test using different browsers. • Update CSS to run the same in local environment. AngularJS Controller Bloat • Use directives to manipulate DOM. • Data should be stored in services. AngularJS Performance • Avoid 2000 watchers on page (higher in 1.3+). • Use Batarang to search for duplication. • Use bind once for expressions which do not change. Dependencies • Review dependencies whenever upgrading tools (npm & bower). Frameworks • "Framework of the week"

Editor's Notes

  1. Challenges Difficultly finding qualified resources Steep learning curve Performance and stability issues Requires deployment by Farm Administrators Lifecycle management Not cloud ready What is a SharePoint 2013 App? Web application that runs “OUTSIDE” of SharePoint Uses Client OM to talk to SharePoint (JS, REST/CSOM) Is the future proof way to add new capabilities to SP2013+ Is available from the Corporate App Catalog or SharePoint Store Is easy to install by site owners or Tenant/Farm administrators
  2. http://blog.xebia.com/2013/09/01/differences-between-providers-in-angularjs/