ember-cli-prismic
The default blueprint for ember-cli addons.
Last updated 3 years ago by jbuget .
MIT · Original npm · Tarball · package.json
$ cnpm install ember-cli-prismic 
SYNC missed versions from official npm registry.

ember-cli-prismic

An ember-cli addon for using prismic.io in Ember.js applications.

This addon provides :

Usage

Install the addon:

ember install ember-cli-prismic

Configure your prismic repository API endpoint:

// config/environment.js

module.exports = function(environment) {
  var ENV = {

    /* config */

    prismic: {
      apiEndpoint: 'https://<your_repository>.prismic.io/api/v2'
      // accessToken: '<your_private_repository_access_token_if_needed>'
    }
  }
}

In your route, controller or component, inject and call the prismic service:

// routes/articles.js

import Route from '@ember/routing/route';
import { inject as service } from '@ember/service';

export default Route.extend({
  prismic: service(),

  model() {
    return this.get('prismic')
      .getApi()
      .then(api => api.query(
        PrismicJS.Predicates.at('document.type', 'blog-post'),
        {
          fetchLinks: 'team-member.complete_name',
          orderings: '[document.last_publication_date desc]',
          page: 2,
          pageSize: 2
        }));
  }
});

See the prismic.io Javascript development kit documentation for more usage.

Contribution

Installation

  • git clone <repository-url> this repository
  • cd ember-cli-prismic
  • npm install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

Current Tags

  • 0.0.8                                ...           latest (3 years ago)

8 Versions

  • 0.0.8                                ...           3 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (9)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |