Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Getting started code and documentation #1270

Merged
merged 1 commit into from
Dec 9, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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([
Expand Down