AngularJS services : design, build, and test services to create a solid foundation for your AngularJS applications /
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.
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Pub.,
2014.
|
Colección: | Community experience distilled.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- 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.