The company backend module

We are going to implement our first backend module for our application. This module will handle everything that is related to a company.

The company model

We are going to add a simple but interesting functionality to the company model, which will create a so-called slug from the company name. A slug, in our context, is generated from the name of the company to be accepted as a valid URL. It will be used to reference the company in a meaningful way. For example, if we have a company named Your Awesome Company in the system, the resulting slug will be your-awesome-company.

To generate the slug, we'll implement a simple helper function so that we can reuse it later if necessary. Create a file called app/helpers/common.js

Get MEAN Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.