From cfe99e34913c155ab7780aea270d8de11f6746cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Mon, 5 Mar 2018 10:55:30 +0100 Subject: [PATCH] lb4: fix usage of Context#get to specify type --- pages/en/lb4/Context.md | 2 +- pages/en/lb4/Decorators.md | 4 ++-- pages/en/lb4/Extending-LoopBack-4.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/en/lb4/Context.md b/pages/en/lb4/Context.md index 35200749c..4a9721aa2 100644 --- a/pages/en/lb4/Context.md +++ b/pages/en/lb4/Context.md @@ -132,7 +132,7 @@ store along with the key. For example: // app level const app = new Application(); app.bind('hello').to('world'); // ContextKey='hello', ContextValue='world' -console.log(app.getSync('hello')); // => 'world' +console.log(app.getSync('hello')); // => 'world' ``` In this case, we bind the 'world' string ContextValue to the 'hello' ContextKey. diff --git a/pages/en/lb4/Decorators.md b/pages/en/lb4/Decorators.md index 369aad6a0..b0d1a6c64 100644 --- a/pages/en/lb4/Decorators.md +++ b/pages/en/lb4/Decorators.md @@ -290,7 +290,7 @@ Syntax: `@inject.tag(tag: string | RegExp)`. .bind('store.locations.sj') .to('San Jose') .tag('store:location'); - const store: Store = ctx.getSync('store'); + const store = ctx.getSync('store'); // `store.locations` is now `['San Francisco', 'San Jose']` ``` @@ -305,7 +305,7 @@ Syntax: `@inject.context()`. const ctx = new Context(); ctx.bind('my-component').toClass(MyComponent); - const component: MyComponent = ctx.getSync('my-component'); + const component = ctx.getSync('my-component'); // `component.ctx` should be the same as `ctx` ``` diff --git a/pages/en/lb4/Extending-LoopBack-4.md b/pages/en/lb4/Extending-LoopBack-4.md index f5783ae75..34bd72032 100644 --- a/pages/en/lb4/Extending-LoopBack-4.md +++ b/pages/en/lb4/Extending-LoopBack-4.md @@ -64,7 +64,7 @@ ctx.bind('utilities.PasswordHash').to((password) => { /* ... */ }) ctx.bind('controllers.UserController').toClass(UserController); // Locate the an instance of UserController from the context -const userController: UserController = await ctx.get('controller.UserController'); +const userController= await ctx.get('controller.UserController'); // Run the log() const ok = await logger.login('John', 'MyPassWord'); ```