|
| 1 | +@ngdoc overview |
| 2 | +@name Tutorial |
| 3 | +@description |
| 4 | + |
| 5 | +A great way to get introduced to Angular is to work through this tutorial, which walks you through |
| 6 | +the construction of an AngularJS web app. The app you will build is a catalog that displays a list |
| 7 | +of Android devices, lets you filter the list to see only devices that interest you, and then view |
| 8 | +details for any device. |
| 9 | + |
| 10 | +<img src="img/tutorial/catalog_screen.png"> |
| 11 | + |
| 12 | +Work through the tutorial to see how Angular makes browsers smarter — without the use of extensions |
| 13 | +or plug-ins. As you work through the tutorial, you will: |
| 14 | + |
| 15 | +* See examples of how to use client-side data binding and dependency injection to build dynamic |
| 16 | +views of data that change immediately in response to user actions. |
| 17 | +* See how Angular creates listeners on your data without the need for DOM manipulation. |
| 18 | +* Learn a better, easier way to test your web apps. |
| 19 | +* Learn how to use Angular services to make common web tasks, such as getting data into your app, |
| 20 | +easier. |
| 21 | + |
| 22 | +And all of this works in any browser without modification to the browser! |
| 23 | + |
| 24 | +When you finish the tutorial you will be able to: |
| 25 | + |
| 26 | +* Create a dynamic application that works in any browser. |
| 27 | +* Define the differences between Angular and common JavaScript frameworks. |
| 28 | +* Understand how data binding works in AngularJS. |
| 29 | +* Use the angular-seed project to quickly boot-strap your own projects. |
| 30 | +* Create and run tests. |
| 31 | +* Identify resources for learning more about AngularJS. |
| 32 | + |
| 33 | +The tutorial guides you through the entire process of building a simple application, including |
| 34 | +writing and running unit and end-to-end tests. Experiments at the end of each step provide |
| 35 | +suggestions for you learn more about AngularJS and the application you are building. |
| 36 | + |
| 37 | +You can go through the whole tutorial in a couple of hours or you may want to spend a pleasant day |
| 38 | +really digging into it. If you're looking for a shorter introduction to AngularJS, check out the |
| 39 | +{@link misc/started Getting Started} document. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +# Working with the code |
| 48 | + |
| 49 | +You can follow this tutorial and hack on the code in either the Mac/Linux or the Windows |
| 50 | +environment. Options for working with the tutorial are to use the Git versioning system for source |
| 51 | +code management or to use scripts that copy snapshots of project files into your workspace |
| 52 | +(`sandbox`) directory. Select one of the tabs below and follow the instructions for setting up your |
| 53 | +computer for your preferred option. |
| 54 | + |
| 55 | +<doc:tutorial-instructions show="true"> |
| 56 | + <doc:tutorial-instruction id="git-mac" title="Git on Mac/Linux"> |
| 57 | + <ol> |
| 58 | + <li><p>Verify that you have <a href="http://java.com/">Java</a> installed by running the |
| 59 | +following command in a terminal window:</p> |
| 60 | + <pre><code>java -version</code></pre> |
| 61 | + <p>You will need Java to run unit tests.</p></li> |
| 62 | + <li><p>Download Git from the <a href="http://git-scm.com/download">Git</a> site.</p> |
| 63 | + <p>You can build Git from source or use the pre-compiled package.</p></li> |
| 64 | + <li><p>Clone the angular-phonecat repository located at <a |
| 65 | +href="https://github.com/angular/angular-phonecat">Github</a> by running the following command:</p> |
| 66 | + <pre><code>git clone git://github.com/angular/angular-phonecat.git</code></pre> |
| 67 | + <p>This command creates the <code>angular-phonecat</code> directory in your current |
| 68 | +directory.</p></li> |
| 69 | + <li><p>Change your current directory to <code>angular-phonecat</code>:</p> |
| 70 | + <pre><code>cd angular-phonecat</code></pre> |
| 71 | + <p>The tutorial instructions assume you are running all commands from the angular-phonecat |
| 72 | +directory.</p></li> |
| 73 | + <li><p>You will need an http server running on your system. Mac and Linux machines typically |
| 74 | +have Apache pre-installed, but If you don't already have one installed, you can <a |
| 75 | +href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">install |
| 76 | +node.js</a>. Use <code>node</code> to run <code>scripts/web-server.js</code>, a simple bundled |
| 77 | +http server.</p></li> |
| 78 | + </ol> |
| 79 | + </doc:tutorial-instruction> |
| 80 | + |
| 81 | + <doc:tutorial-instruction id="git-win" title="Git on Windows"> |
| 82 | + <ol> |
| 83 | + <li><p>You will need Java to run unit tests, so run the following command to verify that you |
| 84 | +have <a href="http://java.com/">Java</a> installed and that the <code>java</code> executable is on |
| 85 | +your <code>PATH</code>.</p> |
| 86 | + <pre><code>java -version</code></pre> |
| 87 | + <p></p></li> |
| 88 | + <li><p>Install msysGit from <a href="http://git-scm.com/download">the Git</a> site.</p></li> |
| 89 | + <li><p>Open msysGit bash and clone the angular-phonecat repository located at <a |
| 90 | +href="https://github.com/angular/angular-phonecat">Github</a> by running the following command:</p> |
| 91 | + <pre><code>git clone git://github.com/angular/angular-phonecat.git</code></pre> |
| 92 | + <p>This command creates the angular-phonecat directory in your current directory.</p></li> |
| 93 | + <li><p>Change your current directory to angular-phonecat.</p> |
| 94 | + <pre><code>cd angular-phonecat</code></pre> |
| 95 | + <p>The tutorial instructions assume you are running all commands from the angular-phonecat |
| 96 | +directory.</p> |
| 97 | + <p>You should run all <code>git</code> commands from msysGit bash.</p> |
| 98 | + <p>Other commands like <code>test-server.bat</code> or <code>test.bat</code> should be |
| 99 | +executed from the Windows command line.</li> |
| 100 | + <li><p>You need an http server running on your system. If you don't already have one |
| 101 | +installed, you can install <a href="http://nodejs.org/">node.js</a>. Download the <a |
| 102 | +href="http://node-js.prcn.co.cc/">pre-compiled binaries</a>, unzip them, and then add |
| 103 | +<code>nodejs\bin</code> into your <code>PATH</code>. Use <code>node</code> to run |
| 104 | +<code>scripts\web-server.js</code>, a simple, bundled http server.</p></li> |
| 105 | + </ol> |
| 106 | + </doc:tutorial-instruction> |
| 107 | + |
| 108 | + <doc:tutorial-instruction id="ss-mac" title="Snapshots on Mac/Linux"> |
| 109 | + <ol> |
| 110 | + <li><p>You need Java to run unit tests, so verify that you have <a |
| 111 | +href="http://java.com/">Java</a> installed by running the following command in a terminal |
| 112 | +window:</p> |
| 113 | + <pre><code>java -version</code></pre> |
| 114 | + <li><p>Download the <a href="http://code.angularjs.org/angular-phonecat/">zip archive</a> |
| 115 | +containing all of the files and unzip them into the [tutorial-dir] directory</p>.</li> |
| 116 | + <li><p>Change your current directory to [tutorial-dir]/sandbox, as follows:</p> |
| 117 | + <pre><code>cd [tutorial-dir]/sandbox</code></pre> |
| 118 | + <p>The tutorial instructions assume you are running all commands from your |
| 119 | +<code>sandbox</code> directory.</p></li> |
| 120 | + <li><p>You need an http server running on your system and Mac and Linux machines typically |
| 121 | +have Apache pre-installed. If you don't have an http server installed, you can <a |
| 122 | +href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">install |
| 123 | +node.js</a> and use it to run <code>scripts/web-server.js</code>, a simple bundled http |
| 124 | +server.</p></li> |
| 125 | + </ol> |
| 126 | + </doc:tutorial-instruction> |
| 127 | + |
| 128 | + <doc:tutorial-instruction id="ss-win" title="Snapshots on Windows"> |
| 129 | + <ol> |
| 130 | + <li><p>Verify that you have <a href="http://java.com/">Java</a> installed and that the |
| 131 | +<code>java</code> executable is on your <code>PATH</code> by running the following command in the |
| 132 | +Windows command line:</p> |
| 133 | + <pre><code>java -version</code></pre> |
| 134 | + <p>You need Java to run unit tests, so download the <a |
| 135 | +href="http://code.angularjs.org/angular-phonecat/">zip archive</a> that contains all of the files |
| 136 | +and unzip the files into the [tutorial-dir] directory</p></li> |
| 137 | + <li><p>Change your current directory to [tutorial-dir]/sandbox, as follows:</p> |
| 138 | + <pre><code>cd [tutorial-dir]/sandbox</code></pre> |
| 139 | + <p>The tutorial instructions assume you are running all commands from this directory.</p></li> |
| 140 | + <li><p>You need an http server running on your system, but if you don't already have one |
| 141 | +already installed, you can install <a href="http://nodejs.org/">node.js</a>. Download the <a |
| 142 | +href="http://node-js.prcn.co.cc/">pre-compiled binaries</a>, unzip them, and then add |
| 143 | +<code>nodejs\bin</code> into your <code>PATH</code>. Use <code>node</code> to run |
| 144 | +<code>scripts\web-server.js</code>, a simple bundled http server.</p></li> |
| 145 | + </ol> |
| 146 | + </doc:tutorial-instruction> |
| 147 | +</doc:tutorial-instructions> |
| 148 | + |
| 149 | +The last thing to do is to make sure your computer has a web browser and a good text editor |
| 150 | +installed. Now, let's get going with {@link step_00 step 0}. |
0 commit comments