Book Image

Websocket Essentials: Building apps with HTML5 websockets

By : Varun Chopra
Book Image

Websocket Essentials: Building apps with HTML5 websockets

By: Varun Chopra

Overview of this book

Table of Contents (13 chapters)
WebSocket Essentials – Building Apps with HTML5 WebSockets
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
6
Enhancing HTML5 Web Application Development Using Modern Tools
Index

Restructure the application


Now that we know about frameworks, let's restructure our application using the AngularJS framework. Let's see what we can restructure here; we will divide everything into model, view, controller, and service layers. Let's see what these terms are and where they fit in our application.

Model

In our application, we have not seen the need to store data, but if we want to extend our application and add more features, then there will be a need for a Model. As we have seen in some scenarios where we have a list of users and drawings, we need the Model to store the data on the client side so that it is easily accessible for use. AngularJS provides good features to store the data and the binding helps in showing the list data very easily in the UI.

View

An application is normally divided into different views, but in our application we just have one view. As we have seen in the scenarios, we need a login screen for users. In that scenario, we need a different view to be set...