{"id":15143636,"url":"https://github.com/contentful/ng-contentful","last_synced_at":"2025-09-29T12:30:38.627Z","repository":{"id":15254764,"uuid":"17983835","full_name":"contentful/ng-contentful","owner":"contentful","description":"Contentful module for AngularJS, providing access to the content delivery API","archived":true,"fork":false,"pushed_at":"2017-05-29T11:09:11.000Z","size":8,"stargazers_count":17,"open_issues_count":2,"forks_count":2,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-09-22T15:32:28.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Senscape/Asylum-Teaser","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contentful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-21T15:15:56.000Z","updated_at":"2023-01-28T21:11:29.000Z","dependencies_parsed_at":"2022-07-22T14:32:16.109Z","dependency_job_id":null,"html_url":"https://github.com/contentful/ng-contentful","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fng-contentful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fng-contentful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fng-contentful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contentful%2Fng-contentful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contentful","download_url":"https://codeload.github.com/contentful/ng-contentful/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219874544,"owners_count":16554590,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-26T10:02:22.738Z","updated_at":"2025-09-29T12:30:33.355Z","avatar_url":"https://github.com/contentful.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This repository is deprecated. There is no further support or maintenence planned.\n\nYou can find a more up to date solution by the community at [https://github.com/jvandemo/angular-contentful](https://github.com/jvandemo/angular-contentful)\n\n---\n\n# ng-contentful\n\nng-contentful is a [AngularJS][angularjs] module for accessing the [Contentful][contentful] CMS\n[content delivery API][docs] and integrate content like blog posts and\narticles into your website or single-page app.\n\nIt wraps the [contentful.js][cfjs] module into AngularJS modules, integrates its asynchronous operations in the digest-cycle and provides a couple of helpers for displaying content.\n\n## What is Contentful ?\n\nContentful is a flexible and future-friendly content management platform to create and manage your content as well as to deliver it onto mobile and web applications and any other platform.\n\n\n## Installation\n\n    bower install ng-contentful\n\nThen just include the file by script-tag.  \nNote that you also need to include `contentful.js` (declared as a dependency in the bower.json).\n\n    \u003cscript type=\"text/javascript\" charset=\"utf-8\" src=\"bower_components/contentful/dist/contentful.min.js\"\u003e\u003c/script\u003e\n    \u003cscript type=\"text/javascript\" charset=\"utf-8\" src=\"bower_components/ng-contentful/ng-contentful.js\"\u003e\u003c/script\u003e\n\n## Setup\n\n1. Require the module\n2. In the config phase you set up your connection like so:\n   ```\n   var myApp = angular.module('myApp', ['ng-contentful']);\n\n   myApp.config(function (contentfulClientProvider) {\n     contentfulClientProvider.setOptions({\n       // any other options, see contentful.js documentation\n     });\n     contentfulClientProvider.setSpaceId('mySpaceId');\n     contentfulClientProvider.setAccessToken('myAccessToken');\n   });\n   ```\n\n## Usage\n\nThere are currently three services available:\n\n- contentfulClient: The base service to make requests to the server\n- ContentTypeList: Mechanism to synchronously and asynchronously look up\n  contentTypes\n- EntryController: Controller to help work with entries\n\n### contentfulClient\n\nRequire the `contentfulClient` service and call the available methods\n(see [Contentful.js documentation][cfjs]. Process the responses via\nPromises:\n\n    myApp.controller('SpaceController', function ($scope, contentfulClient) {\n      contentfulClient.space().then(function (space) {\n        $scope.space = space;\n      });\n    });\n    \n### ContentTypeList\n\nProvides three methods:\n\n- `lookupContentType(id)`: lookup the contentType by id by fetching the\n  information from the server if necessary. Returns a promise.\n- `loadAllContentTypes()`: Loads all available contentTypes from the server.\n  Returns a promise\n- `getContentType(id)`: Synchronously returns contentType. Returns null if\n  contentType is not yet know to the client.\n\n### EntryController\n\nThe EntryController assumes there's an `entry` on the scope.\n\nExposes two methods:\n\n- `$scope.entryTitle()`: Returns the title for an entry\n- `$scope.contentType()`: Returns the contentType for an entry if\n  available locally. If not available, it triggers a lookup and when the\n  lookup is done, $apply gets called so that it then returns the\n  contentType.\n\n## Example\n\nA minimum working code example would have two parts besides the setup (see section \"Setup\").\n\nFirst, you need to load the ContentTypes and entries (for additional arguments to the `entries` call or other methods available on `contentfulClient` please refer to the [Contentful.js documentation][cfjs]):\n```js\nContentTypeList.loadAllContentTypes();\n\ncontentfulClient.entries().then(function(entries){\n  $scope.entries = entries;\n});\n```\n\nThen, to iterate over your entries in a template:\n\n```html\n\u003cdiv ng-repeat=\"entry in entries track by entry.sys.id\" ng-controller=\"EntryController\"\u003e\n  Entry {{entryTitle()}}\n  \u003cul\u003e\n    \u003cli ng-repeat=\"field in contentType().fields track by field.id\"\u003e\n      {{field.name}}: {{entry.fields[field.id]}}\n    \u003c/li\u003e\n  \u003c/ul\u003e\n\u003c/div\u003e\n```\n\nYou can see an example in this Plunker: http://plnkr.co/edit/JboHnB7AgzpizfjbzuIq\n\n[angularjs]: http://angularjs.org\n[contentful]: http://contentful.com\n[docs]: https://www.contentful.com/developers/documentation/content-delivery-api/\n[cfjs]: https://github.com/contentful/contentful.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fng-contentful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontentful%2Fng-contentful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontentful%2Fng-contentful/lists"}