USAGE
A reusable controller module for CRUD operations between Hapi.js and Ember Data
For example:
var controller = ; var PostController = ;
Instead of:
PostController = { ... } { ... } { ... } { ... } { ... }
Use with Ember Data
For use with Ember Data, you will have to set the emberize
to true
, which by default is false. The reason why is to fit with Ember REST API conventions, which are more strictly defined than Angular.js for example.
With emberize
being false
, the JSON passed is:
"_id": "5483d244f673f76109b94e9b" "title": "Hello Everyone" "body": "How's everyone doing now that the thing is changed." "__v": 0 "_id": "548bb1c80b3cf5dd02427434" "title": "Testing the new payload" "body": "tell me what you think." "__v": 0
With emberize
set to true
:
posts: "_id": "5483d244f673f76109b94e9b" "title": "Hello Everyone" "body": "How's everyone doing now that the thing is changed." "__v": 0 "_id": "548bb1c80b3cf5dd02427434" "title": "Testing the new payload" "body": "tell me what you think." "__v": 0