O'Reilly logo

Web Application Development with MEAN by Robert Onodi, Adrian Mejia, Amos Q. Haviv

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The job module

We are going to continue with the job module. The reason for this is that the company module uses a component from the job module in order to display a list of available jobs for a company.

The job service

The job service will handle communication with the backend, mostly for CRUD operations. We are going to create an Angular factory to accomplish this. Create a new file called public/app/job/job.service.js and follow these steps:

  1. Define the base structure and exposed methods:
    import { Injectable } from 'angular2/core'; import { Http, Response, Headers } from 'angular2/http'; import { AuthHttp } from '../auth/index'; import { contentHeaders, serializeQuery } from '../common/index'; import { Job } from './job.model'; @Injectable() export ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required