Skip to content

Commit 3083130

Browse files
examples updated
1 parent cac385c commit 3083130

File tree

4 files changed

+29
-32
lines changed

4 files changed

+29
-32
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Container } from 'container-ioc';
2+
3+
const grandParentContainer = new Container();
4+
5+
const parentContainer = grandParentContainer.createChild();
6+
7+
const childContainer = new Container();
8+
childContainer.setParent(parentContainer);
9+
10+
11+
grandParentContainer.register([
12+
{ token: 'IConfig', useValue: {}}
13+
]);
14+
15+
childContainer.resolve('IConfig');

examples/javascript/injection-token.js

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Container } from 'container-ioc';
2+
3+
const grandParentContainer = new Container();
4+
5+
const parentContainer = grandParentContainer.createChild();
6+
7+
const childContainer = new Container();
8+
childContainer.setParent(parentContainer);
9+
10+
grandParentContainer.register([
11+
{ token: 'IConfig', useValue: {}}
12+
]);
13+
14+
childContainer.resolve('IConfig');

examples/typescript/injection-token.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)