minor grammar fixes
This commit is contained in:
parent
4bea418356
commit
1a5f9f36ec
|
@ -273,14 +273,14 @@ include ../../../../_includes/_util-fns
|
|||
|
||||
When our app loads we see a list of heroes, but a hero is not selected.
|
||||
The `selectedHero` is `undefined`.
|
||||
That’s why we'll' see the following error in the browser’s console:
|
||||
That’s why we'll see the following error in the browser’s console:
|
||||
```
|
||||
EXCEPTION: TypeError: Cannot read property 'name' of undefined in [null]
|
||||
```
|
||||
Remember that we are displaying `selectedHero.name` in the template.
|
||||
This name property does not exist because `selectedHero`itself is undefined.
|
||||
|
||||
We'll' address this problem by keeping the hero detail out of the DOM until there is a selected hero.
|
||||
We'll address this problem by keeping the hero detail out of the DOM until there is a selected hero.
|
||||
|
||||
We wrap the HTML hero detail content of our template with a `<div>`.
|
||||
Then we add the `ng-if` built-in directive and set it to the `selectedHero` property of our component.
|
||||
|
@ -374,7 +374,7 @@ include ../../../../_includes/_util-fns
|
|||
|
||||
:markdown
|
||||
Notice in the template that the `ng-class` name is surrounded in square brackets (`[]`).
|
||||
This is the syntax for a Property Binding, a binding in which data flow one way
|
||||
This is the syntax for a Property Binding, a binding in which data flows one way
|
||||
from the data source (the `getSelectedClass`) to a property of the `ng-class` directive.
|
||||
|
||||
.alert.is-helpful
|
||||
|
|
Loading…
Reference in New Issue