FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs(core/templates): fix various typo and grammatical errors · ElGrecode/angular@a002ed1 · GitHub

forked from angular/angular

Commit a002ed1

Browse files
authored andcommitted
docs(core/templates): fix various typo and grammatical errors
Closes angular#666
1 parent 81bc706 commit a002ed1

1 file changed

Lines changed: 26 additions & 17 deletions

File tree

‎modules/angular2/docs/core/01_templates.md‎

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# Templates
22

3-
Templates are markup which is added to HTML to declarativly describe how the application model should be
3+
Templates are markup which is added to HTML to declaratively describe how the application model should be
44
projected to DOM as well as which DOM events should invoke which methods on the controller. Templates contain
55
syntax which is core to Angular and allows for data-binding, event-binding, template-instantiation.
66

77
The design of the template syntax has these properties:
8+
89

910
* All data-binding expressions are easily identifiable. (i.e. there is never an ambiguity whether the value should be
1011
interpreted as string literal or as an expression.)
1112
* All events and their statements are easily identifiable.
1213
* All places of DOM instantiation are easily identifiable.
13-
* All places of variable declaration is easily identifiable.
14+
* All places of variable declaration are easily identifiable.
1415

15-
The above properties guarantee that the templates are easily to be parsed by tools (such as IDEs) and reasoned about by people.
16-
At no point is it necessary to understand which directives are active and what are their semantics in order to reason
16+
The above properties guarantee that the templates are easy to parse by tools (such as IDEs) and reason about by people.
17+
At no point is it necessary to understand which directives are active or what their semantics are in order to reason
1718
about the template runtime characteristics.
1819

1920

@@ -222,7 +223,11 @@ Example:
222223

223224
## Property Binding
224225

226+
<<<<<<< HEAD
225227
Binding application model data to the UI is the most common kind of bindings in an Angular application. The bindings
228+
=======
229+
Binding application model data to the UI is the most common type of binding in an Angular application. The bindings
230+
>>>>>>> upstream/pr/666
226231
are always in the form of `property-name` which is assigned an `expression`. The generic form is:
227232

228233
<table>
@@ -253,7 +258,11 @@ its value.
253258

254259
Key points:
255260
* The binding is to the element property not the element attribute.
261+
<<<<<<< HEAD
256262
* To prevent custom element from accidentally reading the literal `expression` on the title element, the attribute name
263+
=======
264+
* To prevent a custom element from accidentally reading the literal `expression` on the title element, the attribute name
265+
>>>>>>> upstream/pr/666
257266
is escaped. In our case the `title` is escaped to `[title]` through the addition of square brackets `[]`.
258267
* A binding value (in this case `user.firstName` will always be an expression, never a string literal)
259268

@@ -345,10 +354,10 @@ Where:
345354
inserted. The template can be defined implicitly with `template` attribute, which turns the current element into
346355
a template, or explicitly with `<template>` element. Explicit declaration is longer, but it allows for having
347356
templates which have more than one root DOM node.
348-
* `instantiating-directive` is required for templates. The instantiating directive is responsible for deciding when
349-
and in which order should child views be inserted into this location. An instantiating directive usually has one or
350-
more bindings and can be represented as either `instantiating-directive-bindings` or
351-
`instantiating-directive-microsyntax` on `template` element or attribute. See template microsyntax for more details.
357+
* `viewport` is required for templates. The Viewport directive is responsible for deciding when
358+
and in which order should child views be inserted into this location. An Viewport directive usually has one or
359+
more bindings and can be represented as either `viewport-directive-bindings` or
360+
`viewport-directive-microsyntax` on `template` element or attribute. See template microsyntax for more details.
352361

353362

354363
Example of conditionally included template:
@@ -360,7 +369,7 @@ Hello {{user}}!
360369
</div>
361370
```
362371

363-
In the above example the `if` instantiator determines whether the child view (an instance of the child template) should be
372+
In the above example the `if` Viewport determines whether the child view (an instance of the child template) should be
364373
inserted into the root view. The `if` makes this decision based on if the `isAdministrator` binding is true.
365374

366375
The above example is in the short form, for better clarity let's rewrite it in the canonical form, which is functionally
@@ -375,7 +384,7 @@ Hello {{user}}!
375384
</template>
376385
```
377386

378-
NOTE: Only Instantiator directives can be placed on the template element. (Decorators and Components are not allowed.)
387+
NOTE: Only Viewport directives can be placed on the template element. (Decorators and Components are not allowed.)
379388

380389

381390
### Template Microsyntax
@@ -395,11 +404,11 @@ of the templates occurs. One such example is `foreach`.
395404

396405
Where:
397406
* `foreach` triggers the foreach directive.
398-
* `[in]="people"` binds to an iterable object to the `foreach` controller.
407+
* `[in]="people"` binds an iterable object to the `foreach` controller.
399408
* `#person` exports the implicit `foreach` item.
400409
* `#i=index` exports item index as `i`.
401410

402-
The above example is explicit but quite wordy, for this reason in most situations a short hand version of the
411+
The above example is explicit but quite wordy. For this reason in most situations a short hand version of the
403412
syntax is preferable.
404413

405414
```
@@ -446,7 +455,7 @@ Where
446455
* `internal` is an internal variable which the directive exports for binding.
447456
* `key` is an attribute name usually only used to trigger a specific directive.
448457
* `keyExpression` is an property name to which the expression will be bound to.
449-
* `varExport` allows exporting of a directive internal state as variable for further binding. If no `internal` name
458+
* `varExport` allows exporting of directive internal state as variables for further binding. If no `internal` name
450459
is specified, the exporting is to an implicit variable.
451460
* `microsyntax` allows you to build a simple microsyntax which can still clearly identify which expressions bind to
452461
which properties as well as which variables are exported for binding.
@@ -475,12 +484,12 @@ Binding events allows wiring events from DOM (or other components) to the Angula
475484
</table>
476485

477486
Where:
478-
* `some-element` Any element which can generate DOM events (or has angular directive which generates the event).
487+
* `some-element` Any element which can generate DOM events (or has an angular directive which generates the event).
479488
* `some-event` (escaped with `()` or `bind-`) is the name of the event `some-event`. In this case the
480489
dash-case is converted into camel-case `someEvent`.
481490
* `statement` is a valid statement (as defined in section below).
482491

483-
By default angular only listens to the element on the event, and ignores events which bubble. To listen to bubbled
492+
By default, angular only listens to the element on the event, and ignores events which bubble. To listen to bubbled
484493
events (as in the case of clicking on any child) use the bubble option (`(^event)` or `on-bubble-event`) as shown
485494
bellow.
486495

@@ -508,13 +517,13 @@ class Example {
508517
<button (click)="submit()">Submit</button>
509518
```
510519

511-
In the above example, when clicking on the submit button angular will invoke the `submit` method on the surounding
520+
In the above example, when clicking on the submit button angular will invoke the `submit` method on the surrounding
512521
component's controller.
513522

514523

515524
NOTE: Unlike Angular v1, Angular v2 treats event bindings as core constructs not as directives. This means that there
516525
is no need to create a event directive for each kind of event. This makes it possible for Angular v2 to easily
517-
bind to custom events of Custom Elements, whos event names are not known ahead of time.
526+
bind to custom events of Custom Elements, whose event names are not known ahead of time.
518527

519528

520529

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL