AngularJS services : design, build, and test services to create a solid foundation for your AngularJS applications /

Saved in:
Bibliographic Details
Author / Creator:Lavin, Jim.
Imprint:Birmingham, UK : Packt Pub., 2014.
Description:1 online resource (1 volume) : illustrations
Language:English
Series:Community experience distilled
Community experience distilled.
Subject:
Format: E-Resource Book
URL for this record:http://pi.lib.uchicago.edu/1001/cat/bib/11304611
Hidden Bibliographic Details
Varying Form of Title:Design, build, and test services to create a solid foundation for your AngularJS applications
ISBN:9781783983575
1783983574
1783983574
1783983566
9781783983568
Notes:Online resource; title from title page (Safari, viewed Sept. 17, 2014).
Summary:If you are an intermediate JavaScript developer who is looking to enhance your understanding of single-page web application development with a focus on AngularJS services, then this book is for you.
Other form:Print version: Lavin, Jim. AngularJS Services. Birmingham : Packt Publishing, ©2014 9781783983568
Table of Contents:
  • Cover; Copyright; Credits; About the Author; About the Reviewers; www.PacktPub.com; Table of Contents; Preface; Chapter 1: The Need for Services; AngularJS best practices; Responsibilities of controllers; Responsibilities of directives; Responsibilities of services; Summary; Chapter 2: Designing Services; Measure twice, and cut once; Defining your service''s interface; Focus on the developer, not yourself; Favor readability over brevity; Limit services to a single area of responsibility; Keep method naming consistent; Keep to the top usage scenarios; Do one thing only; Document your interface.
  • Designing for testabilityLaw of Demeter; Pass in required dependencies; Limiting constructors to assignments; Use promises sparingly; Services, factories, and providers; Structuring your service in code; Configuring your service; Summary; Chapter 3: Testing Services; The basics of a test scenario; Loading your modules in a scenario; Mocking data; Mocking services; Mocking services with Jasmine spies; Handling dependencies that return promises; Mocking backend communications; Mocking timers; Summary; Chapter 4: Handling Cross-cutting Concerns.
  • Communicating with your service''s consumers using patternsManaging user notifications; Logging application analytics and errors; Authentication using OAuth 2.0; Summary; Chapter 5: Data Management; Models provide the state and business logic; Implementing a CRUD data service; Caching data to reduce network traffic; Transforming data in the service; Summary; Chapter 6: Mashing in External Services; Storing events with Google calendar; Using Google tasks to build a brewing task list; Tying the Google Calendar and Task List together; Summary; Chapter 7: Implementing the Business Logic.
  • Encapsulating business logic in modelsEncapsulating business logic in services; Models or services, which one to use?; Controlling a view flow with a state machine; Validating complex data with a rules engine; Summary; Chapter 8: Putting It All Together; Wiring in authentication; Displaying notifications and errors; Controlling the application flow; Displaying data from external services; Building and calculating the recipe; Messaging is the heart of the application; Summary; Index.