Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Angular for rubyists

418 views

Published on

A lightening talk (20 slides that show for 20 seconds each) about AngularJS. Talk is here: https://skillsmatter.com/skillscasts/5052-angularjs-for-rubyists

Published in: Technology
  • Be the first to comment

Angular for rubyists

  1. 1. AngularJS for Rubyists It’s like sinatra but for clients Tom Cartwright @tomcartwrightuk ! keepmebooked.com tomcartwright.net
  2. 2. Framework or library? Library Framework Backbone Angular It has conventions (well sort of) Ember
  3. 3. Rails setup config/routes.rb app/controllers/angular_controller.rb app/views/angular/app.html.erb This blank template is needed to stop rails freaking out - there is almost certainly a better way of handling this.
  4. 4. Define an app
  5. 5. Setup some routing app/assets/javascripts/app/app.js
  6. 6. …and a controller app/assets/javascripts/app/controllers.js
  7. 7. A rendered page
  8. 8. As if by magic …some binding occurs …but how?
  9. 9. Dirty checking Check $scopes and copy Check again against the copies Repaint DOM if required
  10. 10. Server communication
  11. 11. $resource service app/assets/javascripts/app/resources.js
  12. 12. Err.. no
  13. 13. app/assets/javascripts/app/resources.js app/assets/javascripts/app/controllers.js
  14. 14. Promises
  15. 15. Testing For unit testing - use Jasmine
  16. 16. spec/javascripts/controller…/dashboardControllerSpec.js
  17. 17. spec/javascripts/controller…/dashboardControllerSpec.js Huzzah!
  18. 18. Directives
  19. 19. The API is doesn’t have to be the source of truth
  20. 20. Thank you $watching $scope.$watch('forQuestions', ! function(silence, question) {! console.log(possibleEruditeResponse);! }! }); Github ・Twitter @tomcartwrightuk Like the sound of this AngularJS stuff? Keepmebooked is hiring

×