refactor(guide): remove setInterval example
It distracts from the flow of this step of the guide, and isn't used in the rest of the guide. The use case of updating data is better covered in the next step of the guide.
This commit is contained in:
parent
1803016cd7
commit
fa8312a1bd
|
@ -103,24 +103,6 @@
|
||||||
While you've used <code>template:</code> to specify an inline view, for larger templates you'd
|
While you've used <code>template:</code> to specify an inline view, for larger templates you'd
|
||||||
want to move them to a separate file and load them with <code>templateUrl:</code> instead.
|
want to move them to a separate file and load them with <code>templateUrl:</code> instead.
|
||||||
|
|
||||||
p To see Angular dynamically update content, add a line after
|
|
||||||
|
|
||||||
code-example(language="html" escape="html").
|
|
||||||
<p>My name: {{ myName }}</p>
|
|
||||||
|
|
||||||
p add this:
|
|
||||||
pre.prettyprint.lang-html
|
|
||||||
code.
|
|
||||||
<p>Current time: {{ time }}</p>
|
|
||||||
p.
|
|
||||||
Then give the <code>DisplayComponent</code> a starting value for time and a call to update time
|
|
||||||
via <code>setInterval</code>.
|
|
||||||
|
|
||||||
pre.prettyprint.lang-javascript
|
|
||||||
code.
|
|
||||||
setInterval(function () { this.time = (new Date()).toString(); }.bind(this), 1000);
|
|
||||||
p Reload the page in your browser and you'll now see the seconds updating automatically.
|
|
||||||
|
|
||||||
.l-main-section
|
.l-main-section
|
||||||
h2#Create-an-array Create an array property and use For on the view
|
h2#Create-an-array Create an array property and use For on the view
|
||||||
p Moving up from a single property, create an array to display as a list.
|
p Moving up from a single property, create an array to display as a list.
|
||||||
|
@ -182,7 +164,7 @@
|
||||||
|
|
||||||
p Reload and you've got your list of friends!
|
p Reload and you've got your list of friends!
|
||||||
p.
|
p.
|
||||||
Again, Angular will mirror changes you make to this list over in the DOM. Add a new item and it appears in your
|
Angular will mirror changes you make to this list over in the DOM. Add a new item and it appears in your
|
||||||
list. Delete one and Angular deletes the <li>. Reorder items and Angular makes the corresponding reorder of
|
list. Delete one and Angular deletes the <li>. Reorder items and Angular makes the corresponding reorder of
|
||||||
the DOM list.
|
the DOM list.
|
||||||
p Let's look at the few lines that do the work again:
|
p Let's look at the few lines that do the work again:
|
||||||
|
|
Loading…
Reference in New Issue