All resources required to implemented app stored in an AppWeb & served up by SharePoint
One page, multiple screens yet no traditional page refreshes
- Reduced round tripping to the server
- Works great in low bandwidth & offline
- Highly interactive
- Routing & navigation
- Page history
- Deep linking
- Templated views & data binding
- Minimal additional deployment steps (sort of)
- No extra costs & concerns
- SPA's yield a richer user experience
- SPA's facilitate modular app development
- Leverage SharePoint for services & data storage
-
Put all JavaScript libraries / vendor scripts in
/Scripts
- Just like
References
is for server side assemblies
- Just like
-
Put your custom JavaScript in
/App
Why? Because you don't want to mix your custom code with scripts & libraries with
Recommendation: Look at John Papa's AngularJS style guide, specifically the section on application structure
- Challenging stuff
- Cool techniques
- SharePoint creates a new AppWeb & throws away the old one when updating the app
- Storing app data in AppWeb's lists/libraries? You'll lose it all on updates!
- Handling app authentication (tokens)
- DO NOT RETURN OAUTH ACCESS TOKENS TO CLIENT
- May need an intermediary (see Research Project Code Sample in Resources section for example)
- Use Google Analytics & virtual page views & custom events to track app usage
- Externalize JavaScript & CSS references to a CDN
- Enables app updates without actually updating the SharePoint app
- Doesn't help with new views
- Utilize A/B testing to see what UX works better for your users
- Combined with Google Analytics => killer customer service offered to your customers
- Use SharePoint workflows to protect sensitive business logic
- If server-side code needed, have workflow call it... app never sees where it went / came from
- Use BCS External Lists to hide where external data came from
#Resources (1)
- AngularJS
- AngularJS in 20 Minutes - from ng-conf
- John Papa's angularjs-styleguide project
- BreezeJS
- AC's SharePoint 2013 SPA Templates
#Resources (2) - Pluralsight on-demand courses
- AngularJS Fundamentals - by Joe Eames
- Building Apps with Angular & Breeze Part 1 & Part 2 - by John Papa
- Building SharePoint Apps as Single Page Apps with AngularJS - by Andrew Connell
#Resources (3) - Sample SharePoint SPA Projects
- OfficeDev - Learning Path Manager Code Sampel by Andrew Connell (same as this one)
- OfficeDev - Research Project Code Sample by Andrew Connell & Scot Hillier
- OfficeDev - SP Angular Expense Manager Code Sample by Dan Wahlin