Permalink
Browse files

feat(configure): Add restOptions param to registerEndpoint

  • Loading branch information...
pfurini committed Oct 28, 2016
1 parent 6ec48b4 commit 886e3e01e817d08b5e38f1aac2657b63e4b93f27
Showing with 7 additions and 2 deletions.
  1. +7 −2 src/config.js
@@ -32,15 +32,20 @@ export class Config {
* @param {string} name The name of the new endpoint.
* @param {Function|string} [configureMethod] Endpoint url or configure method for client.configure().
* @param {{}} [defaults] New defaults for the HttpClient
* @param {{}} [restOptions] Options to pass when constructing the Rest instance.
*
* @see http://aurelia.io/docs.html#/aurelia/fetch-client/latest/doc/api/class/HttpClientConfiguration
* @return {Config} this Fluent interface
* @chainable
*/
registerEndpoint(name: string, configureMethod?: string|Function, defaults?: {}): Config {
registerEndpoint(name: string, configureMethod?: string|Function, defaults?: {}, restOptions?: {useTraditionalUriTemplates?: boolean}): Config {
let newClient = new HttpClient();
let useTraditionalUriTemplates;

this.endpoints[name] = new Rest(newClient, name);
if (restOptions !== undefined) {
useTraditionalUriTemplates = restOptions.useTraditionalUriTemplates;
}
this.endpoints[name] = new Rest(newClient, name, useTraditionalUriTemplates);

// set custom defaults to Rest
if (defaults !== undefined) {

0 comments on commit 886e3e0

Please sign in to comment.