From 0da0596d25d5c5c97baf518f4b62d8c39975f036 Mon Sep 17 00:00:00 2001 From: Alex Bogdanovski Date: Wed, 23 Mar 2016 00:10:53 +0200 Subject: [PATCH] Update API-mapping.md Fixed method names to be lowercase, as required by Restangular. Added example for date formatting. --- doc/API-mapping.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/doc/API-mapping.md b/doc/API-mapping.md index 090a760e..d65f6f2a 100644 --- a/doc/API-mapping.md +++ b/doc/API-mapping.md @@ -112,11 +112,11 @@ myApp.config(['RestangularProvider', function(RestangularProvider) { ## HTTP Method -The REST standard suggests using the POST method to create a new resource, and PUT to update it. If your API uses a different verb for a given action (e.g. PATCH), then you can force the method to be used for a given entity with `createMethod()` and `updateMethod()`. +The REST standard suggests using the POST method to create a new resource, and PUT to update it. If your API uses a different verb for a given action (e.g. PATCH), then you can force the method to be used for a given entity with `createMethod()` and `updateMethod()`. The method name should be in lowercase. ```js -bookEntity.createMethod('PUT'); // default is POST -bookEntity.updateMethod('PATCH'); // default is PUT +bookEntity.createMethod('put'); // default is 'post' +bookEntity.updateMethod('patch'); // default is 'put' ``` ## Pagination @@ -291,3 +291,6 @@ var post = nga.entity('posts') ## Date The default date field format is `yyyy-MM-dd`. You can change it with the `format()` method in fields of type `date`. +```js +nga.field('publication_date', 'date').format('dd MM yyyy') +```