parent
5a6360f6a2
commit
cf2042aa03
|
@ -774,14 +774,13 @@ a#non-class-dependencies
|
||||||
p
|
p
|
||||||
| What if the dependency value isn't a class? Sometimes the thing you want to inject is a
|
| What if the dependency value isn't a class? Sometimes the thing you want to inject is a
|
||||||
block non-class-dep-eg
|
block non-class-dep-eg
|
||||||
span string, function, or object.
|
| span string, function, or object.
|
||||||
p
|
p
|
||||||
| Applications often define configuration objects with lots of small facts
|
| Applications often define configuration objects with lots of small facts
|
||||||
| (like the title of the application or the address of a web API endpoint)
|
| (like the title of the application or the address of a web API endpoint)
|
||||||
block config-obj-maps
|
block config-obj-maps
|
||||||
| but these configuration objects aren't always instances of a class.
|
| but these configuration objects aren't always instances of a class.
|
||||||
| They can be object literals
|
| They can be object literals such as this one:
|
||||||
| such as this one:
|
|
||||||
|
|
||||||
+makeExample('dependency-injection/ts/src/app/app.config.ts','config','src/app/app-config.ts (excerpt)')(format='.')
|
+makeExample('dependency-injection/ts/src/app/app.config.ts','config','src/app/app-config.ts (excerpt)')(format='.')
|
||||||
|
|
||||||
|
|
|
@ -171,7 +171,7 @@ a#expression-context
|
||||||
The context for terms in an expression is a blend of the _template variables_,
|
The context for terms in an expression is a blend of the _template variables_,
|
||||||
the directive's _context_ object (if it has one), and the component's _members_.
|
the directive's _context_ object (if it has one), and the component's _members_.
|
||||||
If you reference a name that belongs to more than one of these namespaces,
|
If you reference a name that belongs to more than one of these namespaces,
|
||||||
the template variable name takes precedence, followed by a name in the directive's' _context_,
|
the template variable name takes precedence, followed by a name in the directive's _context_,
|
||||||
and, lastly, the component's member names.
|
and, lastly, the component's member names.
|
||||||
|
|
||||||
The previous example presents such a name collision. The component has a `hero`
|
The previous example presents such a name collision. The component has a `hero`
|
||||||
|
|
Loading…
Reference in New Issue