2011-05-11 00:45:42 +00:00
|
|
|
@ngdoc overview
|
2011-05-02 17:16:50 +00:00
|
|
|
@name Tutorial: Step 1
|
|
|
|
|
@description
|
|
|
|
|
<table id="tutorial_nav">
|
|
|
|
|
<tr>
|
|
|
|
|
<td id="previous_step">{@link tutorial.step_00 Previous}</td>
|
|
|
|
|
<td id="step_result">{@link http://angular.github.com/angular-phonecat/step-1/app Live
|
2011-05-11 00:45:42 +00:00
|
|
|
Demo}</td>
|
2011-05-02 17:16:50 +00:00
|
|
|
<td id="tut_home">{@link tutorial Tutorial Home}</td>
|
|
|
|
|
<td id="code_diff">
|
|
|
|
|
{@link https://github.com/angular/angular-phonecat/compare/step-0...step-1 Code Diff}</td>
|
|
|
|
|
<td id="next_step">{@link tutorial.step_02 Next}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
|
|
|
|
|
|
2011-05-11 00:45:42 +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-05-02 17:16:50 +00:00
|
|
|
|
|
|
|
|
|
2011-05-11 00:45:42 +00:00
|
|
|
In this step you will add some basic information about two cell phones to an HTML page.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1. Reset the workspace to step 1.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Git users run:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
git checkout -f step-1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Snapshot users run:
|
2011-05-02 17:16:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
./goto_step.sh 1
|
|
|
|
|
|
2011-05-11 00:45:42 +00:00
|
|
|
|
2011-05-02 17:16:50 +00:00
|
|
|
2. Refresh your browser or check the app out on {@link
|
2011-05-11 00:45:42 +00:00
|
|
|
http://angular.github.com/angular-phonecat/step-1/app anglar's server}.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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}:
|
|
|
|
|
|
2011-05-11 00:45:42 +00:00
|
|
|
|
2011-05-02 17:16:50 +00:00
|
|
|
__`app/index.html`:__
|
|
|
|
|
<pre>
|
|
|
|
|
...
|
|
|
|
|
<ul>
|
|
|
|
|
<li>
|
2011-05-11 00:45:42 +00:00
|
|
|
<span>Nexus S</span>
|
2011-05-02 17:16:50 +00:00
|
|
|
<p>
|
|
|
|
|
Fast just got faster with Nexus S.
|
|
|
|
|
</p>
|
|
|
|
|
</li>
|
|
|
|
|
<li>
|
2011-05-11 00:45:42 +00:00
|
|
|
<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-11 00:45:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-05-02 23:40:31 +00:00
|
|
|
# Experiments
|
|
|
|
|
|
|
|
|
|
|
2011-05-11 00:45:42 +00:00
|
|
|
* Try adding more static HTML to `index.html`. For example:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
|
<p>Total number of phones: 2</p>
|
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
|
|
|
2011-05-02 23:40:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# Summary
|
|
|
|
|
|
2011-05-11 00:45:42 +00:00
|
|
|
|
2011-05-02 23:40:31 +00:00
|
|
|
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-05-11 00:45:42 +00:00
|
|
|
|
2011-05-02 17:16:50 +00:00
|
|
|
<table id="tutorial_nav">
|
|
|
|
|
<tr>
|
|
|
|
|
<td id="previous_step">{@link tutorial.step_00 Previous}</td>
|
|
|
|
|
<td id="step_result">{@link http://angular.github.com/angular-phonecat/step-1/app Live
|
2011-05-11 00:45:42 +00:00
|
|
|
Demo}</td>
|
2011-05-02 17:16:50 +00:00
|
|
|
<td id="tut_home">{@link tutorial Tutorial Home}</td>
|
|
|
|
|
<td id="code_diff">
|
|
|
|
|
{@link https://github.com/angular/angular-phonecat/compare/step-0...step-1 Code Diff}</td>
|
|
|
|
|
<td id="next_step">{@link tutorial.step_02 Next}</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
2011-05-11 00:45:42 +00:00
|
|
|
|