Skip to content

shipshapecode/ember-data-url-templates

This branch is 3 commits ahead of amiel/ember-data-url-templates:master.

Folders and files

NameName
Last commit message
Last commit date
Jan 20, 2022
Apr 13, 2018
Oct 26, 2018
Jan 20, 2022
Apr 17, 2015
Jun 19, 2017
Apr 17, 2015
Oct 26, 2018
Oct 26, 2018
Oct 26, 2018
Oct 26, 2018
Oct 26, 2018
Oct 26, 2018
Nov 28, 2015
Oct 26, 2018
Oct 27, 2016
Oct 26, 2018
Oct 26, 2018
Oct 26, 2018
Aug 3, 2020
Oct 26, 2018
Aug 1, 2020

Repository files navigation

ember-data-url-templates

Build Status Ember Observer Score Dependency Status devDependency Status

ember-data-url-templates is an addon to allow building urls with url templates instead of defining buildURL as described in RFC #4.

ember-data-url-templates is under early development. Feedback is welcome, and of course, so are pull requests.

Url templates are compiled with geraintluff/uri-templates, which fully implements RFC 6570.

Usage

Installation

ember install ember-data-url-templates

Requirements

ember-data-url-templates >= 0.1.0 is known to work with ember-data >= 1.0.0-beta.18, ^1.13, and ^2.0.

Documentation

More in depth documentation can be found in the wiki.

Synopsis

// adapters/comment

import Ember from "ember";
import DS from "ember-data";
import UrlTemplates from "ember-data-url-templates";

export default DS.RESTAdapter.extend(UrlTemplates, {
  urlTemplate: '{+host}/comments{/id}',
  queryUrlTemplate: '{+host}/comments{?query*}',
  createRecordUrlTemplate: '{+host}/users/{userId}/comments',

  session: Ember.inject.service(),

  urlSegments: {
    userId() {
      return this.get('session.userId');
    }
  }
});

Contributing

Installation

  • git clone this repository
  • npm install
  • bower install

Running Tests

  • ember test or
  • ember test --server

TODO

Here is a short list of things I'd like to support:

  • Use a template provided by the API (like links)

About

an ember-addon to allow building urls with url templates instead of defining buildURL

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages

  • JavaScript 92.0%
  • HTML 4.8%
  • Handlebars 3.2%