The categories module
The category module will hold all of the logic that is necessary to perform CRUD operations on categories and communicate with the backend through an Angular service.
Category service
The category service is going to be fairly simple, it's only going to manage the CRUD operations on categories. The following steps will describe the process to achieve this:
- Create a file called
public/app/categories/category.service.js
. - Add the necessary business logic:
import { Injectable } from 'angular2/core'; import { Http, Response, Headers } from 'angular2/http'; import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; import { BehaviorSubject } from 'rxjs/Subject/BehaviorSubject'; import { AuthHttp } from '../auth/index'; ...
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.