Skip to content

Commit

Permalink
chore: more feedback
Browse files Browse the repository at this point in the history
More feedback

Signed-off-by: Yaapa Hage <[email protected]>
  • Loading branch information
Yaapa Hage committed Aug 31, 2020
1 parent 56517ca commit 0e0ac32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 6 additions & 0 deletions docs/site/Component.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ These components add additional capabilities to LoopBack.
- [@loopback/typeorm](https://github.com/strongloop/loopback-next/tree/master/extensions/typeorm) -
Adds support for TypeORM in LoopBack

### Community extensions

For a list of components created by community members, refer to
[Community extensions](https://loopback.io/doc/en/lb4/Community-extensions.html)
.

## Creating components

Please refer to [Creating components](Creating-components.md) for more
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
config,
ContextTags,
CoreBindings,
createBindingFromClass,
inject,
} from '@loopback/core';
import {<%= project.bindingsNamespace %>} from './keys'
Expand Down
19 changes: 13 additions & 6 deletions packages/cli/generators/project/templates/README.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ Configure and load <%= project.componentName %> in the application constructor
as shown below.

```ts
...
this.configure(<%= project.componentName %>.COMPONENT).to({
// Put the configuration options here
});
this.component(<%= project.componentName %>);
...
import {<%= project.componentName %>, <%= project.optionsInterface %>, <%= project.defaultOptions %>} from '<%= project.name %>';
// ...
export class MyApplication extends BootMixin(ServiceMixin(RepositoryMixin(RestApplication))) {
constructor(options: ApplicationConfig = {}) {
const opts: <%= project.optionsInterface %> = <%= project.defaultOptions %>;
this.configure(<%= project.bindingsNamespace %>.COMPONENT).to(opts);
// Put the configuration options here
});
this.component(<%= project.componentName %>);
// ...
}
// ...
}
```

0 comments on commit 0e0ac32

Please sign in to comment.