You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bottle will generate nested containers if dot notation is used in the service name. A sub container will be created for you based on the name given:
205
+
Bottle will generate nested containers if dot notation is used in the service name. An isolated sub container will be created for you based on the name given:
200
206
201
207
```js
202
208
var bottle =newBottle();
203
209
varIPA=function() {};
204
210
bottle.service('Beer.IPA', IPA);
205
211
bottle.container.Beer; // this is a new Bottle.container object
206
212
bottle.container.Beer.IPA; // the service
213
+
bottle.factory('Beer.DoubleIPA', function (container) {
214
+
varIPA=container.IPA; // note the container in here is the nearest parent.
215
+
})
216
+
```
217
+
218
+
### Nested Containers Are Isolated
219
+
Nested containers are designed to provide isolation between different packages. This means that you cannot access a nested container from a different parent when you are writing a factory.
A collection of decorators registered by the bottle instance. See `decorator(name, func)` below
280
+
281
+
#### middlewares
282
+
283
+
A collection of middleware registered by the bottle instance. See `middleware(name, func)` below.
284
+
285
+
#### nested
286
+
287
+
A collection of nested bottles registered by the parent bottle instance when dot notation is used to define a service. See "Nested Bottles" section in the documentation above.
288
+
289
+
#### providerMap
290
+
291
+
A collection of registered provider names. Bottle uses this internally to determine whether a provider has already instantiated it's instance. See `provider(name, Provider)` below.
292
+
293
+
#### deferred
294
+
295
+
An array of deferred functions registered for this bottle instance. See `defer(func)` below.
0 commit comments