angular.js/docs/content/tutorial/step_01.ngdoc

58 lines
1.3 KiB
Text
Raw Normal View History

@ngdoc overview
2011-06-06 15:50:35 +00:00
@name Tutorial: 1 - Static Template
2011-05-02 17:16:50 +00:00
@description
2011-06-06 15:50:35 +00:00
<ul doc:tutorial-nav="1"></ul>
2011-06-06 15:50:35 +00:00
In order to illustrate how angular enhances standard HTML, you will create a purely *static* HTML
page and then examine how we can turn this HTML code into a template that angular will use to
dynamically display the same result with any set of data.
2011-06-06 15:50:35 +00:00
In this step you will add some basic information about two cell phones to an HTML page.
2011-06-06 15:50:35 +00:00
<doc:tutorial-instructions step="1" show="true"></doc:tutorial-instructions>
2011-05-02 17:16:50 +00:00
The page now contains a list with information about two phones.
2011-05-02 17:16:50 +00:00
The most important changes are listed below. You can see the full diff on {@link
https://github.com/angular/angular-phonecat/compare/step-0...step-1 GitHub}:
__`app/index.html`:__
<pre>
...
<ul>
<li>
<span>Nexus S</span>
2011-05-02 17:16:50 +00:00
<p>
Fast just got faster with Nexus S.
</p>
</li>
<li>
<span>Motorola XOOM™ with Wi-Fi</span>
2011-05-02 17:16:50 +00:00
<p>
The Next, Next Generation tablet.
</p>
</li>
</ul>
...
</pre>
2011-05-02 23:40:31 +00:00
# Experiments
* Try adding more static HTML to `index.html`. For example:
2011-06-06 15:50:35 +00:00
<p>Total number of phones: 2</p>
2011-05-02 23:40:31 +00:00
# Summary
This addition to your app uses static HTML to display the list. Now, let's go to step 2 to learn
2011-05-02 17:16:50 +00:00
how to use angular to dynamically generate the same list.
2011-06-06 15:50:35 +00:00
<ul doc:tutorial-nav="1"></ul>