Creating a basic MVC project

Our goal in this chapter is to create an app that can pull information from the contacts storage of the local device and display it to the user (a phonebook, if you like). To do so, we need to do the following things:

  • Define a view (template file) to display the contact list
  • Define a controller in order to handle interactions with the list
  • Provide the necessary model logic in order to provide contacts' information.

You may recall that this workflow fits nicely with the overall architecture of AngularJS, which follows the MVC pattern. We will take care of each item in turn.

Creating the view

Go ahead and add the following folder to your projects:

www/templates

Here, we will store all the view templates that we will use throughout ...

Get Learning Node.js for Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.