lolibrarian/nypl-tweetwall

View on GitHub
app/assets/javascripts/angular/services/contentItemsService.js

Summary

Maintainability
A
0 mins
Test Coverage
app.service('contentItemsService', function ($http) {
  // Returns an API URL for the given category slug.
  function url(categorySlug) {
    return '/api/content_items/' + categorySlug + '.json';
  }

  // Returns a promise for Content Items from the API for the given category
  // slug.
  this.get = function (categorySlug) {
    return $http.get(url(categorySlug));
  };
});