Observables and Subscriptions In Angular

How To Create An Observable

ng new application-name
ng serve
Ignore the ‘Angular is running..’ and ‘[WDS] Live Reloading’ logs. They are not part of our blog and do not affect the observable demonstration
The error ends the subscription

A More Practical Example

ng generate component get-the-time
<app-get-the-time></app-get-the-time>
Be sure to include the .toString method in your Observable

Wrapping Up

--

--

--

I ‘m a Web Developer and a Flatiron coding bootcamp alumni. I currently work in the financial tech industry as a Front End Engineer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How Can You Increase I/O Performance With Streams?

Step-by-Step Guide: Set up a Code-First GraphQL Node Server

Parenthesis Balancing using Monoids in TypeScript

Connect Angular Components with Events, Bindings, and Services

Smooth Operator: Concurrent Mode in React

useRef Part II

Theme Concept in Magento 2

What Are Strings in JavaScript?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aidan McBride

Aidan McBride

I ‘m a Web Developer and a Flatiron coding bootcamp alumni. I currently work in the financial tech industry as a Front End Engineer

More from Medium

Angular vs React vs Vue : Which to choose for your career as a UI developer

I have created component server display.

Create your first Angular APP

Rx.js Observables