Skip to content

Commit

Permalink
fix(docs): add troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
dhmlau committed Mar 19, 2019
1 parent 9bcea9d commit 621b4f1
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions docs/site/Calling-other-APIs-and-Web-Services.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,18 @@ export class GeoServiceProvider implements Provider<GeoService> {
}
```

In your application, apply
[ServiceMixin](http://apidocs.loopback.io/@loopback%2fdocs/service-proxy.html#ServiceMixin)
and use `app.serviceProvider` API to create binding for the geo service proxy.

```ts
app.serviceProvider(GeoServiceProvider);
```
### Troubleshooting

Finally, modify the controller to receive our new service proxy in the
constructor:
If you get the error about the
`app.serviceProvider() function is needed for ServiceBooter`, make sure you
apply
[ServiceMixin](http://apidocs.loopback.io/@loopback%2fdocs/service-proxy.html#ServiceMixin)
to your Application class in the `application.ts`.

```ts
export class MyController {
@inject('services.GeoService')
private geoService: GeoService;
}
export class MyLoopBackApplication extends BootMixin(
ServiceMixin(RepositoryMixin(RestApplication)),
)
```
Please refer to
Expand Down

0 comments on commit 621b4f1

Please sign in to comment.