万本电子书0元读

万本电子书0元读

顶部广告

AngularJS Services电子书

售       价:¥

45人正在读 | 0人评论 9.8

作       者:Jim Lavin

出  版  社:Packt Publishing

出版时间:2014-08-21

字       数:32.5万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:此类商品不支持退换货,不支持下载打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
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.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部