SlideShare a Scribd company logo
Building SharePoint Apps
With
By Ahmed Elharouny
22nd October 2014
Page
Agenda
› Introduction
› AppModelOverview(SharePoint-Hosted, SPA,AngularJS, RequireJS)
› High-levelDesign
› Demo&SampleCode
› Optimization
› UnitTesting
› Q&A
/ Copyright ©2014 by Readify Pty Ltd2
Page
Introduction
/ Copyright ©2014 by Readify Pty Ltd3
Ahmed Elharouny
Senior Developer at Readify
http://www.harouny.com
Twitter: @harouny
Github: harouny
• Microsoft Technology Specialist (MCTS Web)
• Professional Scrum Master (PSMI)
• 9 years of experience in web development
• I’m not a SharePoint specialist
• I started SharePoint Live Charts to learn about the new app model
Page
App Model
Overview
/ Copyright ©2014 by Readify Pty Ltd4
Page
SharePoint Hosted
/ Copyright ©2014 by Readify Pty Ltd5
• Development experience
• Instant deployment to SharePoint while modifying in debug mode.
• No external deployment steps
• i.e. IIS, Azure.
• No extra costs & concerns
• Who is paying for resources?
• Leverage SharePoint for services and data storage
• Using client APIs REST or CSOM.
• APP and data is a single unit
• Backup, Restore, Install, Uninstall single unit.
• Still protecting app business logic
• Using business connectivity services and workflows.
Page
Single Page App
/ Copyright ©2014 by Readify Pty Ltd6
• Simpler in development
• No need to manage user moving from page to page.
• Only update what you want to update.
• Persist state on client.
• Rich user experience
• No page reloads.
• Allow of rich UX.
• Progressively download resources when required.
• Modular approach
• Think about modules, not pages.
Page
AngularJS
/ Copyright ©2014 by Readify Pty Ltd7
• A JavaScript framework for building client side applications that
runs in the browser.
• Started by Google but quickly became a popular open source
project.
• It aims to simplify development, maintaining and testing
applications.
Page
AngularJS
/ Copyright ©2014 by Readify Pty Ltd8
1999 Inline
2007 Unobtrusive
Knockout
Angular
2013 Data Binding
Page
AngularJS
/ Copyright ©2014 by Readify Pty Ltd9
• Dependency Injection
• Data Binding
• Routing
• Templates
• MVC or MVVM
• Ajax, REST
• Unit Testing
• Animation
Page
AngularJS
/ Copyright ©2014 by Readify Pty Ltd10
• Modules
• Controllers
• Directives
• Filters
• Services
• Configs
• Routes
Services Recipes
Constant
Page
AngularJS - Modules
/ Copyright ©2014 by Readify Pty Ltd11
- A module is a logical container for the different parts of your app –
controllers, services, filters, directives, etc.
- A module is not a namespace.
DependenciesName
Page
AngularJS - Modules
/ Copyright ©2014 by Readify Pty Ltd12
Page
AngularJS - Controllers
/ Copyright ©2014 by Readify Pty Ltd13
- A Controller is a JavaScript function that is used to work with scope (view
model).
- Controllers are attached to DOM using ng-controller directive.
Name Dependencies Function
Page
AngularJS - Scope
/ Copyright ©2014 by Readify Pty Ltd14
- AngularJS will always create a root scope driven by the ng-app
directive.
ng-app
ng-controller
ng-controller
Page
AngularJS - Directives
/ Copyright ©2014 by Readify Pty Ltd15
Directives are markers on a DOM element that tell AngularJS to attach a
specified behavior to that DOM.
Built-InDirectives
Page
AngularJS - Directives
/ Copyright ©2014 by Readify Pty Ltd16
CustomDirectives
- Custom directive can be used to provide a declarative markup approach
and reusability.
- There are many ways to declare a directive in markup using (HTML
attributes, elements, comments and CSS classes).
Page
AngularJS - Services
/ Copyright ©2014 by Readify Pty Ltd17
- Services is a way to organize and share code across app.
- Services are lazy initialized and singleton.
Built-InServices
• $http
• $log
• $window
CustomServices
Page
RequireJS
/ Copyright ©2014 by Readify Pty Ltd18
• RequireJS is a JavaScript file and module loader.
• It supports Asynchronous Module Definition AMD.
• Asynchronous Module Definition (AMD) API specifies a
mechanism for defining modules such that the module and its
dependencies can be asynchronously loaded.
Page
RequireJS
/ Copyright ©2014 by Readify Pty Ltd19
common.js
common.config.js
• Load scripts faster.
• Manage script dependencies
for you.
• Script loading is
Configurable.
• Mock scripts during test.
Page / Copyright ©2014 by Readify Pty Ltd20
High-level Design
Route
Page / Copyright ©2014 by Readify Pty Ltd21
High-level Design
Page
Demo
/ Copyright ©2014 by Readify Pty Ltd22
https://github.com/harouny/GitHubAppForSharePoint
Sample Code
Page
Optimization
/ Copyright ©2014 by Readify Pty Ltd23
Page
RequireJS Optimizer
/ Copyright ©2014 by Readify Pty Ltd24
• Combine related scripts together into minified files.
• Uses r.js file.
• node is recommended to run it. (java, browser can do it as well).
• Add this to a Post Build Script.
Build output
configs
Build folder
Page
RequireJS Optimizer
/ Copyright ©2014 by Readify Pty Ltd25
• You can switch between the optimized and the non-optimized versions.
• The non-optimized version is needed during development and debugging.
Page
Optimizing HTML files
/ Copyright ©2014 by Readify Pty Ltd26
• You can minify, combine, cache HTML templates used by AngularJS so that
Angular doesn’t need to make an Ajax request for every new template.
• Can be done manually or with a tool like grunt-angular-templates
See it in action
Page
Unit Testing
/ Copyright ©2014 by Readify Pty Ltd27
Page
Unit Testing
/ Copyright ©2014 by Readify Pty Ltd28
• Jasmine
• Chutzpah
• Chutzpah configuration file
• RequireJS setup
• angular-mocks
Page
Q & A
/ Copyright ©2014 by Readify Pty Ltd29
Thank you

More Related Content

PPTX
Portable single page applications with AngularJS in SharePoint
PPTX
Angular patterns
PPTX
Angular vs React: Building modern SharePoint interfaces with SPFx
PPTX
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
PPTX
Building great spa’s with angular js, asp.net mvc and webapi
PPTX
AngularJS
PPT
OSGi and JavaScript - Simon Kaegi
PPTX
OCTO BOF - How to build Netvibes with AngularJS
Portable single page applications with AngularJS in SharePoint
Angular patterns
Angular vs React: Building modern SharePoint interfaces with SPFx
Chris O'Brien - Modern SharePoint sites and the SharePoint Framework - reference
Building great spa’s with angular js, asp.net mvc and webapi
AngularJS
OSGi and JavaScript - Simon Kaegi
OCTO BOF - How to build Netvibes with AngularJS

What's hot (20)

PPTX
Pros and Cons of developing a Thick Clientside App
PDF
Angular resolver tutorial
PPTX
Angular js workshop
PDF
SPUnite17 Timer Jobs Event Handlers
PPTX
Angular overview
PDF
A Simpler Web App Architecture (jDays 2016)
PPTX
Build HTML5 Sites/Apps with Kendo UI Core
PPTX
Angular js for enteprise application
PPTX
Building Quality into the AEM Publication Workflow with Active Standards by D...
PPTX
SPFx- A modern development model for SharePoint
PDF
Server rendering-talk
PPTX
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
PPTX
Single page applications & SharePoint
PPTX
Build Hybrid Mobile Applications for Nokia Lumia Devices
PPTX
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
PPTX
Maurice de Beijer
PDF
How to Build Dynamic Forms in Angular Directive with a Backend
PPTX
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
PPTX
Tom van gaever-sp_serviceapplications_spsbe17
PDF
Angular.js - JS Camp UKraine 2013
Pros and Cons of developing a Thick Clientside App
Angular resolver tutorial
Angular js workshop
SPUnite17 Timer Jobs Event Handlers
Angular overview
A Simpler Web App Architecture (jDays 2016)
Build HTML5 Sites/Apps with Kendo UI Core
Angular js for enteprise application
Building Quality into the AEM Publication Workflow with Active Standards by D...
SPFx- A modern development model for SharePoint
Server rendering-talk
JavaScript MVC Frameworks: Backbone, Ember and Angular JS
Single page applications & SharePoint
Build Hybrid Mobile Applications for Nokia Lumia Devices
Chris O'Brien - Comparing SharePoint add-ins (apps) with Office 365 apps
Maurice de Beijer
How to Build Dynamic Forms in Angular Directive with a Backend
Server Side Responsive Layouts for ASP.NET WebForms using Telerik UI for ASP....
Tom van gaever-sp_serviceapplications_spsbe17
Angular.js - JS Camp UKraine 2013
Ad

Similar to Building share point apps with angularjs (20)

PPTX
Introduction to AngularJs
PPT
Top java script frameworks ppt
PPTX
Intro to AngularJS
PPTX
TallyJS #1 - Intro to AngularJS
PPTX
Training On Angular Js
PDF
Responsive web design with Angularjs
PDF
AngularJS in Production (CTO Forum)
PPTX
Benefits of developing single page web applications using angular js
PPTX
AngularJS Introduction
PDF
Download full ebook of Angularjs Brad Green Shyam Seshadri instant download pdf
PPTX
AngularJS is awesome
PPTX
AngularJS = Browser applications on steroids
PDF
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
PDF
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
PPTX
PPTX
AngularJS Introduction (Talk given on Aug 5 2013)
PDF
Why AngularJS is the Top Choice for Your Next Project
PDF
Beginning MEAN Stack
PPTX
The Growing Popularity of AngularJS
Introduction to AngularJs
Top java script frameworks ppt
Intro to AngularJS
TallyJS #1 - Intro to AngularJS
Training On Angular Js
Responsive web design with Angularjs
AngularJS in Production (CTO Forum)
Benefits of developing single page web applications using angular js
AngularJS Introduction
Download full ebook of Angularjs Brad Green Shyam Seshadri instant download pdf
AngularJS is awesome
AngularJS = Browser applications on steroids
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
AngularJS Introduction (Talk given on Aug 5 2013)
Why AngularJS is the Top Choice for Your Next Project
Beginning MEAN Stack
The Growing Popularity of AngularJS
Ad

More from Ahmed Elharouny (7)

PPTX
Deep dive into azure durable functions
PPTX
Applying microservices principles to front end
PPTX
NoSQL, which way to go?
PPTX
Introduction to require js
PPTX
Advanced Jquery
PPTX
Introduction to Jquery
PPTX
Design patterns
Deep dive into azure durable functions
Applying microservices principles to front end
NoSQL, which way to go?
Introduction to require js
Advanced Jquery
Introduction to Jquery
Design patterns

Recently uploaded (20)

PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Geodesy 1.pptx...............................................
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
DOCX
573137875-Attendance-Management-System-original
PDF
PPT on Performance Review to get promotions
PPTX
Construction Project Organization Group 2.pptx
PDF
Well-logging-methods_new................
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
bas. eng. economics group 4 presentation 1.pptx
Mechanical Engineering MATERIALS Selection
Geodesy 1.pptx...............................................
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
573137875-Attendance-Management-System-original
PPT on Performance Review to get promotions
Construction Project Organization Group 2.pptx
Well-logging-methods_new................
Automation-in-Manufacturing-Chapter-Introduction.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Digital Logic Computer Design lecture notes
CYBER-CRIMES AND SECURITY A guide to understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS

Building share point apps with angularjs

  • 1. Building SharePoint Apps With By Ahmed Elharouny 22nd October 2014
  • 2. Page Agenda › Introduction › AppModelOverview(SharePoint-Hosted, SPA,AngularJS, RequireJS) › High-levelDesign › Demo&SampleCode › Optimization › UnitTesting › Q&A / Copyright ©2014 by Readify Pty Ltd2
  • 3. Page Introduction / Copyright ©2014 by Readify Pty Ltd3 Ahmed Elharouny Senior Developer at Readify http://www.harouny.com Twitter: @harouny Github: harouny • Microsoft Technology Specialist (MCTS Web) • Professional Scrum Master (PSMI) • 9 years of experience in web development • I’m not a SharePoint specialist • I started SharePoint Live Charts to learn about the new app model
  • 4. Page App Model Overview / Copyright ©2014 by Readify Pty Ltd4
  • 5. Page SharePoint Hosted / Copyright ©2014 by Readify Pty Ltd5 • Development experience • Instant deployment to SharePoint while modifying in debug mode. • No external deployment steps • i.e. IIS, Azure. • No extra costs & concerns • Who is paying for resources? • Leverage SharePoint for services and data storage • Using client APIs REST or CSOM. • APP and data is a single unit • Backup, Restore, Install, Uninstall single unit. • Still protecting app business logic • Using business connectivity services and workflows.
  • 6. Page Single Page App / Copyright ©2014 by Readify Pty Ltd6 • Simpler in development • No need to manage user moving from page to page. • Only update what you want to update. • Persist state on client. • Rich user experience • No page reloads. • Allow of rich UX. • Progressively download resources when required. • Modular approach • Think about modules, not pages.
  • 7. Page AngularJS / Copyright ©2014 by Readify Pty Ltd7 • A JavaScript framework for building client side applications that runs in the browser. • Started by Google but quickly became a popular open source project. • It aims to simplify development, maintaining and testing applications.
  • 8. Page AngularJS / Copyright ©2014 by Readify Pty Ltd8 1999 Inline 2007 Unobtrusive Knockout Angular 2013 Data Binding
  • 9. Page AngularJS / Copyright ©2014 by Readify Pty Ltd9 • Dependency Injection • Data Binding • Routing • Templates • MVC or MVVM • Ajax, REST • Unit Testing • Animation
  • 10. Page AngularJS / Copyright ©2014 by Readify Pty Ltd10 • Modules • Controllers • Directives • Filters • Services • Configs • Routes Services Recipes Constant
  • 11. Page AngularJS - Modules / Copyright ©2014 by Readify Pty Ltd11 - A module is a logical container for the different parts of your app – controllers, services, filters, directives, etc. - A module is not a namespace. DependenciesName
  • 12. Page AngularJS - Modules / Copyright ©2014 by Readify Pty Ltd12
  • 13. Page AngularJS - Controllers / Copyright ©2014 by Readify Pty Ltd13 - A Controller is a JavaScript function that is used to work with scope (view model). - Controllers are attached to DOM using ng-controller directive. Name Dependencies Function
  • 14. Page AngularJS - Scope / Copyright ©2014 by Readify Pty Ltd14 - AngularJS will always create a root scope driven by the ng-app directive. ng-app ng-controller ng-controller
  • 15. Page AngularJS - Directives / Copyright ©2014 by Readify Pty Ltd15 Directives are markers on a DOM element that tell AngularJS to attach a specified behavior to that DOM. Built-InDirectives
  • 16. Page AngularJS - Directives / Copyright ©2014 by Readify Pty Ltd16 CustomDirectives - Custom directive can be used to provide a declarative markup approach and reusability. - There are many ways to declare a directive in markup using (HTML attributes, elements, comments and CSS classes).
  • 17. Page AngularJS - Services / Copyright ©2014 by Readify Pty Ltd17 - Services is a way to organize and share code across app. - Services are lazy initialized and singleton. Built-InServices • $http • $log • $window CustomServices
  • 18. Page RequireJS / Copyright ©2014 by Readify Pty Ltd18 • RequireJS is a JavaScript file and module loader. • It supports Asynchronous Module Definition AMD. • Asynchronous Module Definition (AMD) API specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded.
  • 19. Page RequireJS / Copyright ©2014 by Readify Pty Ltd19 common.js common.config.js • Load scripts faster. • Manage script dependencies for you. • Script loading is Configurable. • Mock scripts during test.
  • 20. Page / Copyright ©2014 by Readify Pty Ltd20 High-level Design Route
  • 21. Page / Copyright ©2014 by Readify Pty Ltd21 High-level Design
  • 22. Page Demo / Copyright ©2014 by Readify Pty Ltd22 https://github.com/harouny/GitHubAppForSharePoint Sample Code
  • 23. Page Optimization / Copyright ©2014 by Readify Pty Ltd23
  • 24. Page RequireJS Optimizer / Copyright ©2014 by Readify Pty Ltd24 • Combine related scripts together into minified files. • Uses r.js file. • node is recommended to run it. (java, browser can do it as well). • Add this to a Post Build Script. Build output configs Build folder
  • 25. Page RequireJS Optimizer / Copyright ©2014 by Readify Pty Ltd25 • You can switch between the optimized and the non-optimized versions. • The non-optimized version is needed during development and debugging.
  • 26. Page Optimizing HTML files / Copyright ©2014 by Readify Pty Ltd26 • You can minify, combine, cache HTML templates used by AngularJS so that Angular doesn’t need to make an Ajax request for every new template. • Can be done manually or with a tool like grunt-angular-templates See it in action
  • 27. Page Unit Testing / Copyright ©2014 by Readify Pty Ltd27
  • 28. Page Unit Testing / Copyright ©2014 by Readify Pty Ltd28 • Jasmine • Chutzpah • Chutzpah configuration file • RequireJS setup • angular-mocks
  • 29. Page Q & A / Copyright ©2014 by Readify Pty Ltd29