Skip to content

Commit

Permalink
fix: tsconfig.json for example
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffijoe committed Nov 20, 2017
1 parent 235c3d5 commit 79eecfd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
11 changes: 7 additions & 4 deletions examples/typescript/src/index.ts
Expand Up @@ -9,7 +9,7 @@ import TestService from './services/TestService'
import DependentService from './services/DependentService'

// Create the container
const container: AwilixContainer = createContainer({
const container = createContainer({
injectionMode: InjectionMode.CLASSIC
})

Expand All @@ -19,8 +19,11 @@ container.register({
depService: asClass(DependentService).classic()
})

// Resolve a dependency
let dep: DependentService = container.cradle.depService
// Resolve a dependency using the cradle.
let dep1: DependentService = container.cradle.depService
// Resolve a dependency using `resolve`
let dep2 = container.resolve<DependentService>('depService')

// Test that all is well, should produce 'Hello world!'
console.log(dep.getInnerData())
console.log(dep1.getInnerData())
console.log(dep2.getInnerData())
9 changes: 2 additions & 7 deletions examples/typescript/tsconfig.json
Expand Up @@ -7,11 +7,6 @@
"target": "es5",
"noImplicitAny": true
},
"include": [
"test/**/*.ts"
],
"exclude": [
"dist",
"node_modules"
]
"include": ["src/**/*.ts"],
"exclude": ["dist", "node_modules"]
}

0 comments on commit 79eecfd

Please sign in to comment.