|
3 | 3 | /**
|
4 | 4 | * DESIGN NOTES
|
5 | 5 | *
|
6 |
| - * The design decisions behind the scope ware heavily favored for speed and memory consumption. |
| 6 | + * The design decisions behind the scope are heavily favored for speed and memory consumption. |
7 | 7 | *
|
8 | 8 | * The typical use of scope is to watch the expressions, which most of the time return the same
|
9 | 9 | * value as last time so we optimize the operation.
|
10 | 10 | *
|
11 |
| - * Closures construction is expensive from speed as well as memory: |
12 |
| - * - no closures, instead ups prototypical inheritance for API |
| 11 | + * Closures construction is expensive in terms of speed as well as memory: |
| 12 | + * - No closures, instead ups prototypical inheritance for API |
13 | 13 | * - Internal state needs to be stored on scope directly, which means that private state is
|
14 | 14 | * exposed as $$____ properties
|
15 | 15 | *
|
16 | 16 | * Loop operations are optimized by using while(count--) { ... }
|
17 | 17 | * - this means that in order to keep the same order of execution as addition we have to add
|
18 |
| - * items to the array at the begging (shift) instead of at the end (push) |
| 18 | + * items to the array at the beginning (shift) instead of at the end (push) |
19 | 19 | *
|
20 | 20 | * Child scopes are created and removed often
|
21 |
| - * - Using array would be slow since inserts in meddle are expensive so we use linked list |
| 21 | + * - Using an array would be slow since inserts in middle are expensive so we use linked list |
22 | 22 | *
|
23 | 23 | * There are few watches then a lot of observers. This is why you don't want the observer to be
|
24 | 24 | * implemented in the same way as watch. Watch requires return of initialization function which
|
|
40 | 40 | * @methodOf ng.$rootScopeProvider
|
41 | 41 | * @description
|
42 | 42 | *
|
43 |
| - * Sets the number of digest iteration the scope should attempt to execute before giving up and |
| 43 | + * Sets the number of digest iterations the scope should attempt to execute before giving up and |
44 | 44 | * assuming that the model is unstable.
|
45 | 45 | *
|
46 | 46 | * The current default is 10 iterations.
|
@@ -320,7 +320,7 @@ function $RootScopeProvider(){
|
320 | 320 | * @function
|
321 | 321 | *
|
322 | 322 | * @description
|
323 |
| - * Process all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and its children. |
| 323 | + * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and its children. |
324 | 324 | * Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change the model, the
|
325 | 325 | * `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers} until no more listeners are
|
326 | 326 | * firing. This means that it is possible to get into an infinite loop. This function will throw
|
@@ -662,7 +662,7 @@ function $RootScopeProvider(){
|
662 | 662 | * Afterwards, the event traverses upwards toward the root scope and calls all registered
|
663 | 663 | * listeners along the way. The event will stop propagating if one of the listeners cancels it.
|
664 | 664 | *
|
665 |
| - * Any exception emmited from the {@link ng.$rootScope.Scope#$on listeners} will be passed |
| 665 | + * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed |
666 | 666 | * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
|
667 | 667 | *
|
668 | 668 | * @param {string} name Event name to emit.
|
|
0 commit comments