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
PDF
Introduction to Protractor
PPTX
SPA05-Intro-to-Angular Introduction and its types
KEY
Introduction to Google App Engine
PDF
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
PPTX
Build single page applications using AngularJS on AEM
PDF
Build single page applications using AngularJS on AEM
PPTX
Build single page applications using AngularJS on AEM
PDF
Android Mobile Development Course
PPTX
Applying Advanced Techniques to Azure Web Apps
PPTX
Add Apache Web Server to your Unified Monitoring Toolkit
PPTX
The app of the possible Shailen Sukul MBUG gets Modern Apps and Modern User ...
PPTX
Why choose Angular 6?
PDF
Building your own calendly using amazon app sync
PDF
Adobe App Builder Overview & Get Started Guideline
PPTX
API Services: Building State-of-the-Art APIs
PDF
Sam segal resume
PPTX
Anjular js
PPTX
Selenium topic 3 -Web Driver Basics
PDF
Angular JS Training Agenda
Introduction to AngularJs
Introduction to Protractor
SPA05-Intro-to-Angular Introduction and its types
Introduction to Google App Engine
Tools and Recipes to Replatform Monolithic Apps to Modern Cloud Environments
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
Build single page applications using AngularJS on AEM
Android Mobile Development Course
Applying Advanced Techniques to Azure Web Apps
Add Apache Web Server to your Unified Monitoring Toolkit
The app of the possible Shailen Sukul MBUG gets Modern Apps and Modern User ...
Why choose Angular 6?
Building your own calendly using amazon app sync
Adobe App Builder Overview & Get Started Guideline
API Services: Building State-of-the-Art APIs
Sam segal resume
Anjular js
Selenium topic 3 -Web Driver Basics
Angular JS Training Agenda
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)

PPTX
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
PPTX
Internship_Presentation_Final engineering.pptx
PPTX
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
PPTX
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
PPT
Project quality management in manufacturing
PPTX
Geodesy 1.pptx...............................................
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
web development for engineering and engineering
PPTX
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
composite construction of structures.pdf
PDF
ETO & MEO Certificate of Competency Questions and Answers
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPT
Drone Technology Electronics components_1
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PDF
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
DOCX
573137875-Attendance-Management-System-original
Unit 5 BSP.pptxytrrftyyydfyujfttyczcgvcd
Internship_Presentation_Final engineering.pptx
Fluid Mechanics, Module 3: Basics of Fluid Mechanics
ANIMAL INTERVENTION WARNING SYSTEM (4).pptx
Project quality management in manufacturing
Geodesy 1.pptx...............................................
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
web development for engineering and engineering
MET 305 MODULE 1 KTU 2019 SCHEME 25.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
composite construction of structures.pdf
ETO & MEO Certificate of Competency Questions and Answers
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Drone Technology Electronics components_1
UNIT-1 - COAL BASED THERMAL POWER PLANTS
Arduino robotics embedded978-1-4302-3184-4.pdf
algorithms-16-00088-v2hghjjnjnhhhnnjhj.pdf
573137875-Attendance-Management-System-original

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