My Angular.js and Node.js Chat App

October 16, 2013 — 2 Comments

Hey everyone, check out this chat app I built today using Node.js and Angular.js: Node & Angular Chat App

Node and Angular are both relatively new javascript frameworks that pack a lot of power.  Node is a platform for building really fast network applications that can run on many different devices.  It is great at processing multiple connections without blocking and is one of the most important javascript developments in the last 5 years.  I’ll likely use Node extensively in the future running on Raspberry Pi to build some cool Internet of Things devices.

Angular is a javascript framework, maintained by Google, that can serve as a backbone for single-page web application.  It augments browser-based applications with MVC (model-view-controller) capability and enables rapid prototyping with easy-to-read code.  Angular’s two-way data binding reduces the amount of code that needs to be written and brings templating responsibilities to the client side.  Angular is often compared to Backbone.js, which relies on boilerplate code instead of two way data-binding.

2 responses to My Angular.js and Node.js Chat App

  1. 

    Instead of doing this:
    `
    setInterval(function(){
    $http.get(“/chat”).success(function(data,status){
    $scope.items = data.reverse()
    });
    },500);
    `
    you can use a realtime library like socket.io since you’re using node. There’s even an AngularJS service for the socket.io client.

  2. 

    Instead of doing this:
    setInterval(function(){
    $http.get(“/chat”).success(function(data,status){
    $scope.items = data.reverse()
    });
    },500);
    you can use socket.io to transfer all your msg back and forth. There’s a seed for the socket.io client as an angularjs service.

Let me know whether you like this post and/or how it can be improved!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s