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

Minor: fix some typos in Getting-started.md #815

Merged
merged 1 commit into from
Nov 25, 2015
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
16 changes: 8 additions & 8 deletions doc/Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var myApp = angular.module('myApp', ['ng-admin']);
myApp.config(['NgAdminConfigurationProvider', function (nga) {
// create an admin application
var admin = nga.application('My First Admin');
// more configuation here later
// more configuration here later
// ...
// attach the admin application to the DOM and execute it
nga.configure(admin);
Expand Down Expand Up @@ -155,7 +155,7 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
nga.field('email')
]);
// add the user entity to the admin application
admin.addEntity(user)
admin.addEntity(user);
// attach the admin application to the DOM and execute it
nga.configure(admin);
}]);
Expand Down Expand Up @@ -270,7 +270,7 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
nga.field('title'),
nga.field('userId')
]);
admin.addEntity(post)
admin.addEntity(post);

nga.configure(admin);
}]);
Expand All @@ -294,7 +294,7 @@ post.listView().fields([
.targetField(nga.field('username'))
.label('User')
]);
admin.addEntity(post)
admin.addEntity(post);
```

![Mapped post list view with related user](images/mapped_post_list_view_with_related_user.png)
Expand All @@ -307,7 +307,7 @@ The syntax of the reference definition may seem strange, let's take a closer loo
nga.field('userId', 'reference')
.targetEntity(user)
.targetField(nga.field('username'))
.label('User')
.label('User');
```

`nga.field()` returns an instance of the Field object. As the type is specified, it's a `ReferenceField` object. The `targetEntity()` method allows to set the endpoint to use to fetch the related entity. It expects an entity object, and returns the current reference field object. That way, you can chain the call to the `targetField()` method, which defines the field of the target entity that should be displayed instead of the user id. `targetField()` also returns the `ReferenceField` object, so the `label()` method can be called inline.
Expand Down Expand Up @@ -370,7 +370,7 @@ user.creationView().fields([
]);
// use the same fields for the editionView as for the creationView
user.editionView().fields(user.creationView().fields());
admin.addEntity(user)
admin.addEntity(user);
```

The fields of the creation view map the structure of a typical user from the JSONPlaceholder response:
Expand Down Expand Up @@ -610,7 +610,7 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
nga.field('name').isDetailLink(true),
nga.field('username'),
nga.field('email')
])
]);
user.creationView().fields([
nga.field('name')
.validation({ required: true, minlength: 3, maxlength: 100 }),
Expand Down Expand Up @@ -679,7 +679,7 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
.sortField('id')
.sortDir('DESC'),
]);
admin.addEntity(post)
admin.addEntity(post);

admin.menu(nga.menu()
.addChild(nga.menu(user).icon('<span class="glyphicon glyphicon-user"></span>'))
Expand Down