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

React Lifecycle Methods

2022. 03. 23 Today I did / Today I learned

Learn GatsbyJS by creating a tourism site -6

My notes about conducting a massive refactor in a Vue.js website

How to create admin dashboard with charts using Reactjs and D3js

Automatic Dark Mode With JavaScript

Deep and Shallow Copy in JavaScript

How to Become a Web Developer Within a Month

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 Best Practices — 2022

Angular

Knowing the differences between Angular vs Angular JS

how to consume API in angular

Angular Form Errors Component