I'm trying to learn the HTML5/Node.js/Express/MongoDB/AngularJS/Websocket thing that seems to have everyone excited right now.
As a slight backfire, I'm actually having difficulty drawing lines on what each technology actually does (especially with ejs as a template engine). Javascript and HTML everywhere!
Particularly, I'm having trouble separating the services provided by websockets (or something like socket.io), and AngularJS. They both seem to try to offer dynamism without having to resend an entire HTML page.
Are they substitutes for one another? Or do they serve different purposes?
Also, both these technologies seem to move towards single-page web applications that bypass Express' routing. What then, is leveraged by Express when using Websockets/AngularJS? It seems like the traditional routing offered by Express is substituted for just altering the view in a single-page in AngularJS
AngularJS is a javascript library which does lots and lots of different things. The one of those many things which is closest related to WebSockets is the layer on top of the vanilla Javascript feature XmlHttpRequest.
Both XmlHttpRequest and WebSockets are techniques for exchanging data with a server without having to reload the website. The difference is that XmlHttpRequest (often referred to as AJAX) follows a request-response model (the client makes a request, the server answers), while WebSockets use a bidirectional channel where both the client and the server can send messages at any time.
Express.js can do a lot but it's speed as a node.js web server is the best benefit for me here.
When I make an Angular app (usually building with Yeoman), I first install an express app and run Yeoman's angular-generator, then edit app.js to remove view/routing references and to serve up the /dist folder that yeoman creates after Grunt tests and minifies everything.
In this way, I get to use Angular as a full-fledged MVC, including routing. I haven't used websockets with this configuration, tho maybe I'd want to for database (MongoDB or any other) communications and/or data indexing - especially useful for non-relational DBs.