| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
 | @ngdoc overview
@name Tutorial: Step 0
@description
<table id="tutorial_nav">
<tr>
<td id="previous_step">{@link tutorial Previous}</td>
<td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-0/app Live Demo}</td>
<td id="tut_home">{@link tutorial Tutorial Home}</td>
<td id="code_diff">Code Diff</td>
<td id="next_step">{@link tutorial.step_01 Next}</td>
</tr>
</table>
You are now ready to build the phone cat application. In this step, you will become familiar with
the most important source code files, learn how to start the development servers bundled with
angular-seed, and run the application in the browser.
1. Do one of the following:
   * Git users: In the `angular-phonecat` directory, run this command:
               git checkout -f step-0
   * Snapshot users: In the `[tutorial-dir]/sandbox` directory, run this command:
               ./goto_step.sh 0
  This resets your workspace to Step 0 of the tutorial app.
  You must repeat this for every future step in the tutorial and change the number to the number of
the step you are on. Either command will cause any changes you made within your working directory
to be lost.
2. To see the app running in a browser, do one of the following:
   * __For node.js users:__
       1. In a _separate_ terminal tab or window, run `./scripts/web-server.js` to start the app
server.
       2. Open a browser window for the app and navigate to http://localhost:8000/app/index.html.
   * __For other http servers:__
       1. Configure the server to serve the files in the `angular-phonecat` directory.
       2. Navigate in your browser to
http://localhost:[*port-number*]/[*context-path*]/app/index.html.
You can now see the page in your browser. It's not very exciting, but that's OK.
The static HTML page that displays "Nothing here yet!" was constructed with the HTML code shown
below. The code contains some key angular elements that we will need going forward.
__`app/index.html`:__
<pre>
<!doctype html>
<html xmlns:ng="http://angularjs.org/">
<head>
  <meta charset="utf-8">
  <title>my angular app</title>
  <link rel="stylesheet" href="css/app.css"/>
</head>
<body>
  Nothing here yet!
  <script src="lib/angular/angular.js" ng:autobind></script>
</body>
</html>
</pre>
## What is the code doing?
* xmlns declaration
       <html xmlns:ng="http://angularjs.org">
  This `xmlns` declaration for the `ng` namespace must be specified in all angular applications in
order to make angular work with XHTML and IE versions older than 9 (regardless of whether you are
using XHTML or HTML).
* angular script tag
       <script src="lib/angular/angular.js" ng:autobind>
  This single line of code is all that is needed to bootstrap an angular application.
  The code downloads the `angular.js` script and registers a callback that will be executed by the
browser when the containing HTML page is fully downloaded. When the callback is executed, angular
looks for the {@link angular.directive.ng:autobind ng:autobind} attribute. If angular finds
`ng:autobind`, it creates a root scope for the application and associates it with the `<html>`
element of the template:
     <img src="img/tutorial/tutorial_00_final.png"/>
    As you will see shortly, everything in angular is evaluated within a scope. We'll learn more
about this in the next steps.
## What are all these files in my working directory?
Most of the files in your working directory come from the {@link
https://github.com/angular/angular-seed angular-seed project} which is typically used to bootstrap
new angular projects. The seed project includes the latest angular libraries, test libraries,
scripts and a simple example app, all pre-configured for developing a typical web app.
For the purposes of this tutorial, we modified the angular-seed with the following changes:
* Removed the example app
* Added phone images to `app/img/phones`
* Added phone data files (JSON) to `app/phones`
# Summary
Now let's go to step 1 and add some content to the web app.
<table id="tutorial_nav">
<tr>
<td id="previous_step">{@link tutorial Previous}</td>
<td id="step_result">{@link  http://angular.github.com/angular-phonecat/step-0/app Live Demo}</td>
<td id="tut_home">{@link tutorial Tutorial Home}</td>
<td id="code_diff">Code Diff</td>
<td id="next_step">{@link tutorial.step_01 Next}</td>
</tr>
</table>
 |