From 2dc31ec58b5b88254ec97ae9d9ee17817110f78a Mon Sep 17 00:00:00 2001 From: Greg Date: Thu, 8 Dec 2016 12:04:16 +0100 Subject: [PATCH] Fix Getting started code and documentation Remove the note abut nonexistent entity being created automatically Fix the getting started code --- doc/Getting-started.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/Getting-started.md b/doc/Getting-started.md index 6caa05cd..fb7d7b90 100644 --- a/doc/Getting-started.md +++ b/doc/Getting-started.md @@ -340,8 +340,6 @@ post.showView().fields([ The `referenced_list` field type displays a datagrid for one-to-many relationships. In this examples, by specifying how comments and posts are related (via the `postId` field in the referenced `comments`), ng-admin manages to fetch related entities. -As a side note, you can see that it's possible to create a reference to a non-existent entity (`nga.entity('comments)` creates the related entity for the occasion). - The new post show view is directly accessible from the listView, by clicking on the id of a post in the list. ![post show view with related comments](images/post_show_view_with_related_comments.png) @@ -604,6 +602,9 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) { var admin = nga.application('My First Admin') .baseApiUrl('http://jsonplaceholder.typicode.com/'); // main API endpoint + var comment = nga.entity('comments'); // the API endpoint for users will be 'http://jsonplaceholder.typicode.com/comments/:id + admin.addEntity(comment); + var user = nga.entity('users'); // the API endpoint for users will be 'http://jsonplaceholder.typicode.com/users/:id user.listView() .fields([