Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Angular 2 Cookbook

You're reading from   Angular 2 Cookbook Discover over 70 recipes that provide the solutions you need to know to face every challenge in Angular 2 head on

Arrow left icon
Product type Paperback
Published in Jan 2017
Publisher Packt
ISBN-13 9781785881923
Length 464 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Matthew Frisbie Matthew Frisbie
Author Profile Icon Matthew Frisbie
Matthew Frisbie
Patrick Gillespie Patrick Gillespie
Author Profile Icon Patrick Gillespie
Patrick Gillespie
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Strategies for Upgrading to Angular 2 2. Conquering Components and Directives FREE CHAPTER 3. Building Template-Driven and Reactive Forms 4. Mastering Promises 5. ReactiveX Observables 6. The Component Router 7. Services, Dependency Injection, and NgModule 8. Application Organization and Management 9. Angular 2 Testing 10. Performance and Advanced Concepts

Introduction

Before you get into the meat of Angular 2 Observables, it is important to first understand the problem you are trying to solve.

A frequently encountered scenario in software is where you are expecting some entity to broadcast that something happened; let's call this an "event" (distinct from a browser event). You would like to hook into this entity and attach behavior to it whenever an event occurs. You would also like to be able to detach from this entity when you no longer care about the events it is broadcasting.

There is more nuance and additional complexity to Observables that this chapter will cover, but this concept of events underscores the fundamental pattern that is useful to you as the developer.

The Observer Pattern

The Observer Pattern isn't a library or framework. It is just a software design pattern upon which ReactiveX Observables are built. Many languages and libraries implement this pattern, and ReactiveX is just one of these implementations...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime