The CategoryService objects is a singleton object because it is an AngularJS service. The service will interact with our CMS APIs powered by the Spring Boot application.
We will use the $http service. It makes the HTTP communications easier.
Let's write the CategoryService:
(function (angular) { 'use strict'; /* Services */</span> angular.module('cms.modules.category.services', []). service('CategoryService', ['$http', function ($http) { var serviceAddress = 'http://localhost:8080'; var urlCollections = serviceAddress + '/api/category'; var urlBase = serviceAddress + '/api/category/'; this.find = function () { return $http.get(urlCollections); }; this.findOne = function (id) { return $http.get(urlBase + id)