From 93070f14885801de7e264b04fdf4cb54b7dc7d9b Mon Sep 17 00:00:00 2001 From: Matt Rohrer Date: Wed, 26 Sep 2012 15:30:55 +0200 Subject: docs(guide): minor grammar fixes --- docs/content/guide/expression.ngdoc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'docs/content/guide/expression.ngdoc') diff --git a/docs/content/guide/expression.ngdoc b/docs/content/guide/expression.ngdoc index 469381ff..59839c63 100644 --- a/docs/content/guide/expression.ngdoc +++ b/docs/content/guide/expression.ngdoc @@ -15,10 +15,9 @@ For example, these are all valid expressions in angular: ## Angular Expressions vs. JS Expressions -It might be tempting to think of angular view expressions as JavaScript expressions, but that is -not entirely correct, since angular does not use a JavaScript `eval()` to evaluate expressions. -You can think of angular expressions as JavaScript expressions with following differences -differences: +It might be tempting to think of Angular view expressions as JavaScript expressions, but that is +not entirely correct, since Angular does not use a JavaScript `eval()` to evaluate expressions. +You can think of Angular expressions as JavaScript expressions with following differences: * **Attribute Evaluation:** evaluation of all properties are against the scope, doing the evaluation, unlike in JavaScript where the expressions are evaluated against the global @@ -92,9 +91,9 @@ You can try evaluating different expressions here: # Property Evaluation Evaluation of all properties takes place against a scope. Unlike JavaScript, where names default -to global window properties, angular expressions have to use {@link api/ng.$window +to global window properties, Angular expressions have to use {@link api/ng.$window `$window`} to refer to the global `window` object. For example, if you want to call `alert()`, which is -defined on `window`, in an expression must use `$window.alert()`. This is done intentionally to +defined on `window`, in an expression you must use `$window.alert()`. This is done intentionally to prevent accidental access to the global state (a common source of subtle bugs). @@ -148,7 +147,7 @@ Similarly, invoking a function `a.b.c()` on undefined or null simply returns und ## No Control Flow Statements You cannot write a control flow statement in an expression. The reason behind this is core to the -angular philosophy that application logic should be in controllers, not in the view. If you need a +Angular philosophy that application logic should be in controllers, not in the view. If you need a conditional, loop, or to throw from a view expression, delegate to a JavaScript method instead. @@ -179,9 +178,9 @@ You might be wondering, what is the significance of the $ prefix? It is simply a angular uses, to differentiate its API names from others. If angular didn't use $, then evaluating `a.length()` would return undefined because neither a nor angular define such a property. -Consider that in a future version of angular we might choose to add a length method, in which case +Consider that in a future version of Angular we might choose to add a length method, in which case the behavior of the expression would change. Worse yet, you the developer could create a length -property and then we would have a collision. This problem exists because angular augments existing +property and then we would have a collision. This problem exists because Angular augments existing objects with additional behavior. By prefixing its additions with $ we are reserving our namespace -so that angular developers and developers who use angular can develop in harmony without collisions. +so that angular developers and developers who use Angular can develop in harmony without collisions. -- cgit v1.2.3