added a common function to refresh the chat text on specific events
added a common function to refresh the chat text on specific events

iliyan-trifonov/chat-nodejs-angularjs-socketio,iliyan-trifonov/chat-nodejs-angularjs-socketio