Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit e2c77ad

Browse files
committed
docs(dependency-injection): tweak Dart wording
closes #1017
1 parent 3b768a3 commit e2c77ad

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

public/docs/ts/latest/guide/dependency-injection.jade

+5-2
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,13 @@ code-example(format, language="html").
704704
The injector resolves these tokens and injects the corresponding services into the matching factory function parameters.
705705
// #enddocregion providers-factory-4
706706
// #docregion providers-factory-5
707+
- var lang = current.path[1]
708+
- var anexportedvar = lang == 'dart' ? 'a constant' : 'an exported variable'
709+
- var variable = lang == 'dart' ? 'constant' : 'variable'
707710
:marked
708-
Notice that we captured the factory provider in an exported variable, `heroServiceProvider`.
711+
Notice that we captured the factory provider in #{anexportedvar}, `heroServiceProvider`.
709712
This extra step makes the factory provider reusable.
710-
We can register our `HeroService` with this variable wherever we need it.
713+
We can register our `HeroService` with this #{variable} wherever we need it.
711714

712715
In our sample, we need it only in the `HeroesComponent`,
713716
where it replaces the previous `HeroService` registration in the metadata `providers` array.

public/docs/ts/latest/guide/template-syntax.jade

+6-6
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ table
571571
If the name fails to match a property of a known directive or element, Angular reports an “unknown directive” error.
572572

573573
### Avoid side effects
574-
As we've already discussed, evaluation of a template expression should have no visible side effects. The expression language itself does its part to keep us safe. We can’t assign a value to anything in a property binding expression nor use the increment and decorator operators.
574+
As we've already discussed, evaluation of a template expression should have no visible side effects. The expression language itself does its part to keep us safe. We can’t assign a value to anything in a property binding expression nor use the increment and decrement operators.
575575

576576
Of course, our expression might invoke a property or method that has side effects. Angular has no way of knowing that or stopping us.
577577

@@ -940,16 +940,16 @@ code-example(format="", language="html").
940940
// #docregion ngModel-5
941941
.l-sub-section
942942
:marked
943-
The `ngModel` input property sets the element's value property and the `ngModelChange` output property
943+
The `ngModel` input property sets the element's value property and the `ngModelChange` output property
944944
listens for changes to the element's value.
945945
The details are specific to each kind of element and therefore the `NgModel` directive only works for elements,
946946
such as the input text box, that are supported by a [ControlValueAccessor](../api/common/ControlValueAccessor-interface.html).
947947
We can't apply `[(ngModel)]` to our custom components until we write a suitable *value accessor*,
948948
a technique that is out of scope for this chapter.
949-
949+
950950
:marked
951951
Separate `ngModel` bindings is an improvement. We can do better.
952-
952+
953953
We shouldn't have to mention the data property twice. Angular should be able to capture the component’s data property and set it
954954
with a single declaration — which it can with the `[( )]` syntax:
955955
// #enddocregion ngModel-5
@@ -960,11 +960,11 @@ code-example(format="", language="html").
960960
:marked
961961
`[(ngModel)]` is a specific example of a more general pattern in which Angular "de-sugars" the `[(x)]` syntax
962962
into an `x` input property for property binding and an `xChange` output property for event binding.
963-
Angular constructs the event property binding's template statement by appending `=$event`
963+
Angular constructs the event property binding's template statement by appending `=$event`
964964
to the literal string of the template expression.
965965
code-example(format="." ).
966966
[(x)]="hero.name" <==> [x]="hero.name" (xChange)="hero.name=$event"
967-
967+
968968
:marked
969969
We can write a two-way binding directive of our own to exploit this behavior.
970970

0 commit comments

Comments
 (0)