MEAN Blueprints by Robert Onodi

MEAN Blueprints by Robert Onodi

Author:Robert Onodi [Onodi, Robert]
Language: eng
Format: epub, azw3, pdf
Publisher: Packt Publishing
Published: 2016-05-29T21:00:00+00:00


Export the router:module.exports = router;

The job backend module

This module will implement all of the backend logic related to jobs. We are going to define the necessary models and controllers. Only the most important parts of the module will be explained.

The job model

The job model will define a single entity from the Jobs collection and is going to handle the necessary validation when creating a new job. As for the company model, we are going to use a custom variable file for job industries and types. The two files will be located at jobboard/config/variables/industries.js and jobboard/config/variables/jobtypes.js, respectively. Both export a list of objects.

In order to implement the job model, we are going to follow these steps:

Create the model file, called jobboard/app/models/job.js.

Add the necessary dependencies:const mongoose = require('mongoose'); const commonHelper = require('../helpers/common'); const Industries = require('../../config/variables/industries'); const Countries = require('../../config/variables/countries'); const Jobtypes = require('../../config/variables/jobtypes'); const Schema = mongoose.Schema; const ObjectId = Schema.ObjectId;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.