Cover image for AngularJS Services.
AngularJS Services.
Title:
AngularJS Services.
Author:
Lavin, Jim.
ISBN:
9781783983575
Personal Author:
Physical Description:
1 online resource (164 pages)
Contents:
AngularJS Services -- Table of Contents -- AngularJS Services -- Credits -- About the Author -- About the Reviewers -- www.PacktPub.com -- Support files, eBooks, discount offers, and more -- Why subscribe? -- Free access for Packt account holders -- Preface -- What this book covers -- What you need for this book -- Who this book is for -- Conventions -- Reader feedback -- Customer support -- Downloading the example code -- Errata -- Piracy -- Questions -- 1. The Need for Services -- AngularJS best practices -- Responsibilities of controllers -- Responsibilities of directives -- Responsibilities of services -- Summary -- 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 testability -- Law 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 -- 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 -- 4. Handling Cross-cutting Concerns -- Communicating with your service's consumers using patterns -- Managing user notifications -- Logging application analytics and errors -- Authentication using OAuth 2.0 -- Summary -- 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 -- 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 -- 7. Implementing the Business Logic -- Encapsulating business logic in models -- Encapsulating 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 -- 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.
Abstract:
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.
Local Note:
Electronic reproduction. Ann Arbor, Michigan : ProQuest Ebook Central, 2017. Available via World Wide Web. Access may be limited to ProQuest Ebook Central affiliated libraries.
Electronic Access:
Click to View
Holds: Copies: