A Real World Case Study
David Carter and Matt Tester
A bit of history…
• jQuery – lots of fun but things got pretty messy in the end
• Knockout – fantastic at first but still didn’t solve a lot of our issues
• Kendo UI – fell for what promised to be a great framework but really never
delivered
• Now, AngularJS and Asp.Net Web API / Node
MVC
Overview
Routing & View Composition
• Don’t use the default router
• Angular ui-router – state engine
• Ideally every view/state in your app should be reachable via a URL
• Nice place to put authorization in your app
• Pages can easily be composed of multiple views and controllers
• Allows you to instantiate data before view is rendered
Customer Page States
customers
customer/{id}
customer/{id}/
details
customer/{id}}/
contacts
customer/{id}/
correspondence
customer/{id}/
reports
customers/add
Communicating with the Server
• $http – low level service for http communications
• Better - $Resource - supports action methods: get, save, query, remove,
delete
• Best – RestAngular
 Great for working with a RESTful API
 Returns promises – perfect for ui-router
 Supports self-linking elements
 Supports nested RESTful resources
Views & Directives
• Makes HTML readable
• Great for abstraction
• Great for use with layout frameworks, e.g. Bootstrap
• Complicated, should not be taken lightly!
Scope
Likes
• It covers all the bases (routing, dependency injection, MVVM, etc)
• Feels like we don’t have to roll anything ourselves
• Good code re-use with directives
• Semantic HTML
• Good community
• Good docs and resources
• Don’t have to write a lot of code
Dislikes
• Feels way to complicated in places (scope & directives)
• Not opinionated enough, lots of ways to do things (e.g. factory vs service)
• Steep learning curve (take that into account)
• Can tend to hide mistakes
• Can be difficult to debug
• Lack of 3rd party components
Should YOU use it for your next
project?
• Can you factor in plenty of time for the learning curve?
• Can you wait for Angular 2.0 to come out?

Angular - a real world case study

  • 1.
    A Real WorldCase Study David Carter and Matt Tester
  • 2.
    A bit ofhistory… • jQuery – lots of fun but things got pretty messy in the end • Knockout – fantastic at first but still didn’t solve a lot of our issues • Kendo UI – fell for what promised to be a great framework but really never delivered • Now, AngularJS and Asp.Net Web API / Node MVC
  • 3.
  • 4.
    Routing & ViewComposition • Don’t use the default router • Angular ui-router – state engine • Ideally every view/state in your app should be reachable via a URL • Nice place to put authorization in your app • Pages can easily be composed of multiple views and controllers • Allows you to instantiate data before view is rendered
  • 6.
  • 7.
    Communicating with theServer • $http – low level service for http communications • Better - $Resource - supports action methods: get, save, query, remove, delete • Best – RestAngular  Great for working with a RESTful API  Returns promises – perfect for ui-router  Supports self-linking elements  Supports nested RESTful resources
  • 8.
    Views & Directives •Makes HTML readable • Great for abstraction • Great for use with layout frameworks, e.g. Bootstrap • Complicated, should not be taken lightly!
  • 9.
  • 10.
    Likes • It coversall the bases (routing, dependency injection, MVVM, etc) • Feels like we don’t have to roll anything ourselves • Good code re-use with directives • Semantic HTML • Good community • Good docs and resources • Don’t have to write a lot of code
  • 11.
    Dislikes • Feels wayto complicated in places (scope & directives) • Not opinionated enough, lots of ways to do things (e.g. factory vs service) • Steep learning curve (take that into account) • Can tend to hide mistakes • Can be difficult to debug • Lack of 3rd party components
  • 12.
    Should YOU useit for your next project? • Can you factor in plenty of time for the learning curve? • Can you wait for Angular 2.0 to come out?