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 Web Application Development with MEAN 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.