Skip to content

Commit 4ceb865

Browse files
jcruz2usmhevery
authored andcommitted
docs(01_templates.md): typos
Fix spelling errors in 01_templates.md Closes angular#585
1 parent 320c089 commit 4ceb865

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

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

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The design of template syntax has these properties:
88

99
* All data-binding expressions are easily identifiable. (i.e. there is never an ambiguity wether the value should be
1010
interpreted as string literal or as an expression.)
11-
* All events and their statments are easily identifiable.
11+
* All events and their statements are easily identifiable.
1212
* All places of DOM instantiation are easily identifiable.
1313
* All places of variable declaration is esily identifiable.
1414

@@ -300,7 +300,7 @@ keeping `null` and `undefined` as empty strings.
300300
## Inline Templates
301301

302302
Data binding allows updating the DOM's properties, but it does not allow for changing of the DOM structure. To change
303-
DOM structure we need the ability to define child templates, and than instantiat these templates into Views. The
303+
DOM structure we need the ability to define child templates, and then instantiate these templates into Views. The
304304
Views can than be inserted and removed as needed to change the DOM structure.
305305

306306
<table>
@@ -370,8 +370,8 @@ NOTE: Only Instantiator directives can be placed on the template element. (Decor
370370

371371
### Template Microsyntax
372372

373-
Often times it is necessary to encode a lot of different bindings into a template to controll how the instantiation
374-
of the templates occures. One such example is foreach.
373+
Often times it is necessary to encode a lot of different bindings into a template to control how the instantiation
374+
of the templates occurs. One such example is foreach.
375375

376376
```
377377
<form #foo=form>
@@ -389,8 +389,8 @@ Where:
389389
* `#person` exports the implicit `foreach` item.
390390
* `#i=index` exports item index as `i`.
391391

392-
The above example is explicit but quite wordy, for this reason in most situatios a short hand version of the
393-
syntax is prefferable.
392+
The above example is explicit but quite wordy, for this reason in most situations a short hand version of the
393+
syntax is preferable.
394394

395395
```
396396
<ul>
@@ -399,7 +399,7 @@ syntax is prefferable.
399399
```
400400

401401
Notice how each key value pair is translated to `key=value;` statement in the `template` attribute. This makes the
402-
repeat syntax a much shorter, but we can do better. Turns out that most punctuation is opional in the short version
402+
repeat syntax a much shorter, but we can do better. Turns out that most punctuation is optional in the short version
403403
which allows us to further shorten the text.
404404

405405
```
@@ -408,7 +408,7 @@ which allows us to further shorten the text.
408408
</ul>
409409
```
410410

411-
We can also optionaly use `var` instead of `#` and add `:` to `foreach` which creates the following recomended
411+
We can also optionally use `var` instead of `#` and add `:` to `foreach` which creates the following recommended
412412
microsyntax for `foreach`.
413413

414414
```
@@ -432,18 +432,18 @@ microsyntax: ([[key|keyExpression|varExport][;|,]?)*
432432

433433
Where
434434
* `expression` is an angular expression as defined in section: Expressions
435-
* `local` is a local identifiar for local variables.
435+
* `local` is a local identifier for local variables.
436436
* `internal` is an internal variable which the directive exports for binding.
437437
* `key` is an attribute name usually only used to trigger a specific directive.
438438
* `keyExpression` is an property name to which the epression will be bound to.
439-
* `varExport` allows exporting of directive internal state as varibles for further binding. If no `internal` name
439+
* `varExport` allows exporting of directive internal state as variables for further binding. If no `internal` name
440440
is specified than the exporting is to an implicit variable.
441441
* `microsyntax` allows you to build simple microsyntax which can still clearly identify which expressions bind to
442-
which properties as well as which varibales are exported for binding.
442+
which properties as well as which variables are exported for binding.
443443

444444

445445
NOTE: the `template` attribute must be present to make it clear to the user that a sub-template is being created. This
446-
goes allong the philosophy that the developer should be able to reason about the template without understanding the
446+
goes along the philosophy that the developer should be able to reason about the template without understanding the
447447
semantics of the instantiator directive.
448448

449449

@@ -470,7 +470,7 @@ Where:
470470
dash-case is converted into camel-case `someEvent`.
471471
* `statement` is a valid statement (as defined in section below).
472472

473-
By default angular anly listens to the element on the event, and ignores events which bubble. To listen to bubbled
473+
By default angular only listens to the element on the event, and ignores events which bubble. To listen to bubbled
474474
events (as in the case of clicking on any child) use the bubble option (`(^event)` or `on-bubble-event`) as shown
475475
bellow.
476476

@@ -511,7 +511,7 @@ bind to custom events of Custom Elements, whos event names are not known ahead o
511511

512512
## Expressions, Statements and Formatters
513513

514-
Angular templates contain expressions for binding to data and statments for binding to events. Expressions and statments
514+
Angular templates contain expressions for binding to data and statements for binding to events. Expressions and statements
515515
have different semantics.
516516

517517

@@ -527,15 +527,15 @@ Angular are:
527527
<div template="if: expression">...</div>
528528
```
529529

530-
Expressions are simplified version of expression in the langugage in which you are writing your application. (i.e.
531-
expressions fallow JS syntax and semantics in JS and Dart syntax and semantics in Dart). Unlike expressions in the
532-
langugage, binding expressions behave differently in following ways:
530+
Expressions are simplified version of expression in the language in which you are writing your application. (i.e.
531+
expressions follow JS syntax and semantics in JS and Dart syntax and semantics in Dart). Unlike expressions in the
532+
language, binding expressions behave differently in following ways:
533533

534-
* *Must be defined*: Anlike Angular v1, Angular v2 will throw an error on dereferencing fields which are not defined.
534+
* *Must be defined*: Unlike Angular v1, Angular v2 will throw an error on dereferencing fields which are not defined.
535535
For example: `user.name` will throw an error if `user` is defined but it does not have `name` property. If the `name`
536536
property is not known, it must be declared and set to some value such as empty string, `null` (or `undefined` in JS).
537537
This is done to allow early detection of errors in the templates.
538-
* *Safe dereference*: Expressions `user.name` where `user` is null will throw `NullPointerException` in the langugage.
538+
* *Safe dereference*: Expressions `user.name` where `user` is null will throw `NullPointerException` in the language.
539539
In contrast Angular will silently ignore `null` on `user`. This is done because Views often have to wait for the data
540540
to arrive from the backend and many fields will be `null` until the data arrives. Safe dereference is so common in the
541541
Views, that we have made it the default.
@@ -559,32 +559,32 @@ class Greeter {
559559
property is `null` or `undefined`. Example of: safe dereference.
560560
* `foo`: Will thrown on error because `foo` is not declared on the `Greeter` class. Example of: Must be defined
561561
* `name=1`: Not allowed because fo assignment.
562-
* `name; name.length`: Not allowed because of multiple statments.
562+
* `name; name.length`: Not allowed because of multiple statements.
563563

564564

565565

566566
### Statements
567567

568568
Statements can be used to bind to events only. Statements represent actions to trigger as a response to an event.
569-
Examples of where statments can be used in Angular are:
569+
Examples of where statements can be used in Angular are:
570570
```
571-
<div (click)="statments">...</div>
572-
<div on-click="statments">...</div>
571+
<div (click)="statements">...</div>
572+
<div on-click="statements">...</div>
573573
```
574574

575-
Statements are similar to statments in the langugage in which you are writing your application. (i.e.
576-
statments follow JS syntax and semantics in JS and Dart syntax and semantics in Dart). Unlike statments in the
577-
langugage, binding expressions behave differently in following ways:
575+
Statements are similar to statements in the language in which you are writing your application. (i.e.
576+
statements follow JS syntax and semantics in JS and Dart syntax and semantics in Dart). Unlike statements in the
577+
language, binding expressions behave differently in following ways:
578578

579579
* *Unsafe dereference*: Expressions `user.verify()` where `user` is `null` will throw `NullPointerException` in the
580-
langugage as well as in statments. (In contrast to Safe dereference in Angular expressions.) While angular protects
581-
you from null dereferencing in expressions due to lazy loading of data, no such protection is required for statments,
580+
language as well as in statements. (In contrast to Safe dereference in Angular expressions.) While angular protects
581+
you from null dereferencing in expressions due to lazy loading of data, no such protection is required for statements,
582582
and doing so would make it harder to detect typos in statements.
583-
* *Multiple statements OK*: Statements can be composed from more than one statemnet. (i.e. no `doA(); doB()`)
583+
* *Multiple statements OK*: Statements can be composed from more than one statement. (i.e. no `doA(); doB()`)
584584
* *Assignments OK*: Event bindings can have side effects and hence assignments are allowed.
585585
* *No keywords*: Statements can not contain keywords such as: `var`, `if`, and so on.
586-
* *No Formatters*: Angular statements can not contain formatters. (Formatters are only usefull for data binding)
586+
* *No Formatters*: Angular statements can not contain formatters. (Formatters are only useful for data binding)
587587

588588
## Further Reading
589589

590-
* [Template Syntax Constraints and Reasoning](https://docs.google.com/document/d/1HHy_zPLGqJj0bHMiWPzPCxn1pO5GlOYwmv-qGgl4f_s)
590+
* [Template Syntax Constraints and Reasoning](https://docs.google.com/document/d/1HHy_zPLGqJj0bHMiWPzPCxn1pO5GlOYwmv-qGgl4f_s)

0 commit comments

Comments
 (0)