Book Image

Learning Single-page Web Application Development

Book Image

Learning Single-page Web Application Development

Overview of this book

Table of Contents (15 chapters)
Learning Single-page Web Application Development
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Refactoring the API


Let's see how we can create both tasks at the same time with the help of the subgenerator CRUD module:

  1. In the terminal, type the following command:

    yo meanjs:crud-module speakers
    

    Note that the last word is the name we give to the module that will be created.

    Tip

    More information about the MEAN.JS generator and sub-generator CRUD can be found at http://meanjs.org/generator.html#crud-module.

    After the process, we have the following information on the terminal window:

    Note that we respond to the three optional questions while creating the new module: whether we want to include a folder for CSS and images and two directories for Angular, directives and filters. For the purpose of this example, we chose not to include the directories of CSS and images; we will see why later.

    Tip

    Don't forget to keep the server running with the node server command each time you need to test something on the browser; if you don't do so, use nodemon.

  2. Now, let's test what we created. Open the browser...