-
Notifications
You must be signed in to change notification settings - Fork 2
Angular Bonus SocketIO
If you've gotten to the Stock Charting Back End Project you may have noticed that the bonus criteria is to have your stock list live update across clients. This can be accomplished with SocketIO, but that's not all SocketIO can do. Remember earlier, I mentioned that when using $http.post you had to update your local array with the database's version of the item you were posting? SocketIO keeps a user's browser environment synced with your database in realtime. This has two practical upshots:
- You no longer have to manually update your local data with database data; it is all managed automatically
- You can push database changes live to users on different machines all at the same time
Even better, if you just include SocketIO when prompted during the yeoman angular-fullstack setup, there is absolutely no work involved to include it. It works out of the box, has a working demo on the main/ route, and you can learn how to use it yourself by simply looking at how they include it in main.controller.js (so I won't go any further into detail).
Learn to code and help nonprofits. Join our open source community in 15 seconds at http://freecodecamp.com
Follow our Medium blog
Follow Quincy on Quora
Follow us on Twitter
Like us on Facebook
And be sure to click the "Star" button in the upper right of this page.
New to Free Code Camp?
JS Concepts
JS Language Reference
- arguments
- Array.prototype.filter
- Array.prototype.indexOf
- Array.prototype.map
- Array.prototype.pop
- Array.prototype.push
- Array.prototype.shift
- Array.prototype.slice
- Array.prototype.some
- Array.prototype.toString
- Boolean
- for loop
- for..in loop
- for..of loop
- String.prototype.split
- String.prototype.toLowerCase
- String.prototype.toUpperCase
- undefined
Other Links