diff options
Diffstat (limited to 'docs')
23 files changed, 211 insertions, 110 deletions
| diff --git a/docs/content/tutorial/index.ngdoc b/docs/content/tutorial/index.ngdoc index c26ea2df..1190aaf2 100644 --- a/docs/content/tutorial/index.ngdoc +++ b/docs/content/tutorial/index.ngdoc @@ -2,12 +2,12 @@  @name Tutorial  @description -A great way to get introduced to Angular is to work through this tutorial, which walks you through +A great way to get introduced to AngularJS is to work through this tutorial, which walks you through  the construction of an AngularJS web app. The app you will build is a catalog that displays a list  of Android devices, lets you filter the list to see only devices that interest you, and then view  details for any device. -<img src="img/tutorial/catalog_screen.png"> +<img src="img/tutorial/catalog_screen.png" width="488" height="413">  Work through the tutorial to see how Angular makes browsers smarter — without the use of extensions  or plug-ins. As you work through the tutorial, you will: @@ -72,9 +72,8 @@ directory.</p></li>  directory.</p></li>        <li><p>You will need an http server running on your system. Mac and Linux machines typically  have Apache pre-installed, but If you don't already have one installed, you can <a -href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">install -node.js</a>. Use <code>node</code> to run <code>scripts/web-server.js</code>,  a simple bundled -http server.</p></li> +href="http://nodejs.org/#download">install node.js</a>. Use <code>node</code> to run +<code>scripts/web-server.js</code>,  a simple bundled http server.</p></li>      </ol>    </doc:tutorial-instruction> @@ -97,11 +96,10 @@ directory.</p>        <p>You should run all <code>git</code> commands from msysGit bash.</p>        <p>Other commands like <code>test-server.bat</code> or <code>test.bat</code> should be  executed from the Windows command line.</li> -      <li><p>You need an http server running on your system. If you don't already have one -installed, you can install <a href="http://nodejs.org/">node.js</a>. Download the <a -href="http://node-js.prcn.co.cc/">pre-compiled binaries</a>, unzip them, and then add -<code>nodejs\bin</code> into your <code>PATH</code>. Use <code>node</code> to run -<code>scripts\web-server.js</code>, a simple, bundled http server.</p></li> +      <li><p>You need an http server running on your system, but if you don't already have one +already installed, you can install <a href="http://nodejs.org/#download">node.js</a>. Make sure that +<code>nodejs\bin</code> was added into your <code>PATH</code>. Use <code>node</code> to run +<code>scripts\web-server.js</code>, a simple bundled http server.</p></li>      </ol>    </doc:tutorial-instruction> @@ -119,9 +117,8 @@ containing all of the files and unzip them into the [tutorial-dir] directory</p>  <code>sandbox</code> directory.</p></li>        <li><p>You need an http server running on your system and Mac and Linux machines typically  have Apache pre-installed. If you don't have an http server installed, you can <a -href="https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager">install -node.js</a> and use it to run <code>scripts/web-server.js</code>, a simple bundled http -server.</p></li> +href="http://nodejs.org/#download">install node.js</a> and use it to run +<code>scripts/web-server.js</code>, a simple bundled http server.</p></li>      </ol>    </doc:tutorial-instruction> @@ -138,13 +135,14 @@ and unzip the files into the [tutorial-dir] directory</p></li>        <pre><code>cd [tutorial-dir]/sandbox</code></pre>        <p>The tutorial instructions assume you are running all commands from this directory.</p></li>        <li><p>You need an http server running on your system, but if you don't already have one -already installed, you can install <a href="http://nodejs.org/">node.js</a>. Download the <a -href="http://node-js.prcn.co.cc/">pre-compiled binaries</a>, unzip them, and then add -<code>nodejs\bin</code> into your <code>PATH</code>. Use <code>node</code> to run +already installed, you can install <a href="http://nodejs.org/#download">node.js</a>. Make sure that +<code>nodejs\bin</code> was added into your <code>PATH</code>. Use <code>node</code> to run  <code>scripts\web-server.js</code>, a simple bundled http server.</p></li>      </ol>    </doc:tutorial-instruction>  </doc:tutorial-instructions>  The last thing to do is to make sure your computer has a web browser and a good text editor -installed. Now, let's get going with {@link step_00 step 0}. +installed. Now, let's get some cool stuff done! + +{@link step_00 <span class="tutorial-start">Get Started!</span>} diff --git a/docs/content/tutorial/step_00.ngdoc b/docs/content/tutorial/step_00.ngdoc index b7f469ff..643ec23b 100644 --- a/docs/content/tutorial/step_00.ngdoc +++ b/docs/content/tutorial/step_00.ngdoc @@ -1,11 +1,11 @@  @ngdoc overview -@name Tutorial: 0 - angular-seed +@name Tutorial: 0 - Bootstrapping  @description  <ul doc:tutorial-nav="0"></ul> -You are now ready to build the Angular phonecat application. In this step, you will become familiar +You are now ready to build the AngularJS phonecat app. 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. @@ -143,23 +143,23 @@ href="http://localhost:8000/app/index.html">http://localhost:8000/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. +The 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/" ng:app> +<html ng-app>  <head>    <meta charset="utf-8">    <title>my angular app</title> -  <link rel="stylesheet" href="css/app.css"/> +  <link rel="stylesheet" href="css/app.css"> +  <script src="lib/angular/angular.js"></script>  </head>  <body> -  Nothing here yet! +  Nothing here {{'yet' + '!'}} -  <script src="lib/angular/angular.js"></script>  </body>  </html>  </pre> @@ -168,30 +168,70 @@ __`app/index.html`:__  ## What is the code doing? -* xmlns declaration +* `ng-app` directive: -          <html xmlns:ng="http://angularjs.org" ng:app> +          <html ng-app> -  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). +  `ng-app` directive is a special tag used to flag an element which Angular should consider to be +  the root element of our application. This gives application developers the freedom to tell Angular +  if the entire html page or only a portion of it should be treated as the Angular application. -* Angular script tag +* AngularJS script tag:            <script src="lib/angular/angular.js"> -  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 +  This 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 api/angular.directive.ng:app ng:app} attribute. If Angular finds -`ng:app`, it creates a root scope for the application and associates it with the element of -when `ng:app` was declared. +looks for the {@link api/angular.module.ng.$compileProvider.directive.ng-app ng-app} directive. If +Angular finds `ng-app`, it will bootstrap the application with the root of the application DOM being +the element on which the `ng-app` directive was defined. + +* Double-curly binding with an expression: + +          Nothing here {{'yet' + '!'}}` + +  This line demonstrates the core feature of Angular's templating capabilities – a binding, denoted +  by double-curlies `{{ }}` as well as a simple expression `'yet' + '!'` used in this binding. + +  The binding tells Angular, that it should evaluate an expression and insert the result into the +  DOM in place of the binding. Rather than a one-time insert, as we'll see in the next steps, a +  binding will result in efficient continuous updates whenever the result of the expression +  evaluation changes. + +  {@link guide/dev_guide.expressions Angular expression} is a JavaScript-like code snippet that is +  evaluated by Angular in the context of the current model scope, rather than within the scope of +  the global context (`window`). + +  As expected, once this template is processed by Angular, the html page will contains text: +  "Nothing here yet!". + +## Bootstrapping AngularJS apps + +Bootstrapping AngularJS apps automatically using the `ng-app` directive is very easy and suitable +for most cases. In advanced cases, such as when using script loaders, you can use +{@link guide/dev_guide.bootstrap.manual_bootstrap imperative / manual way} to bootstrap the app. + +There are 3 important things that happen during the app bootstrap: + +1. The {@link api/angular.module.AUTO.$injector injector} that will be used for dependency injection +   within this app is created. -  <img src="img/tutorial/tutorial_00_final.png"> +2. The injector will then create the {@link api/angular.module.ng.$rootScope root scope} that will +   become the context for the model of our application. -    As you will see shortly, everything in Angular is evaluated within a scope. We'll learn more -about this in the next steps. +3. Angular will then "compile" the DOM starting at the `ng-app` root element, processing any +   directives and bindings found along the way. + + +Once an application is bootstrapped, it will then wait for incoming browser events (such as mouse +click, key press or incoming HTTP response) that might change the model. Once such event occurs, +Angular detects if it caused any model changes and if changes are found, Angular will reflect them +in the view by updating all of the affected bindings. + +The structure of our application is currently very simple. The template contains just one directive +and one static binding, and our model is empty. That will soon change! + +<img src="img/tutorial/tutorial_00.png">  ## What are all these files in my working directory? @@ -208,9 +248,25 @@ For the purposes of this tutorial, we modified the angular-seed with the followi  * Added phone data files (JSON) to `app/phones` + +# Experiments + +* Try adding a new expression to the `index.html` that will do some math: + +          <p>1 + 2 = {{ 1 + 2 }}</p> + + +  # Summary  Now let's go to {@link step_01 step 1} and add some content to the web app.  <ul doc:tutorial-nav="0"></ul> + +Move elsewhere: + +Note: During the bootstrap the injector and the root scope will then be associated with the +   element on which `ng-app` was declared, so when debugging the app you can retrieve them from +   browser console via `angular.element(rootElement).scope()` and +   `angular.element(rootElement).injector()`. diff --git a/docs/content/tutorial/step_01.ngdoc b/docs/content/tutorial/step_01.ngdoc index fb8eb26e..11725031 100644 --- a/docs/content/tutorial/step_01.ngdoc +++ b/docs/content/tutorial/step_01.ngdoc @@ -51,7 +51,7 @@ __`app/index.html`:__  # Summary  This addition to your app uses static HTML to display the list. Now, let's go to {@link step_02 -step 2} to learn how to use angular to dynamically generate the same list. +step 2} to learn how to use AngularJS to dynamically generate the same list.  <ul doc:tutorial-nav="1"></ul> diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc index ceeb0e92..e0ca2829 100644 --- a/docs/content/tutorial/step_02.ngdoc +++ b/docs/content/tutorial/step_02.ngdoc @@ -5,7 +5,7 @@  <ul doc:tutorial-nav="2"></ul> -Now it's time to make the web page dynamic -- with Angular. We'll also add a test that verifies the +Now it's time to make the web page dynamic — with AngularJS. We'll also add a test that verifies the  code for the controller we are going to add.  There are many ways to structure the code for an application. For Angular apps, we encourage the @@ -23,64 +23,64 @@ The most important changes are listed below. You can see the full diff on {@link  https://github.com/angular/angular-phonecat/compare/step-1...step-2 GitHub}: -## Template for the View +## View and Template -The __view__ component is constructed by Angular from this template: +In Angular, the __view__ is a projection of the model through the HTML __template__. This means that +whenever the model changes, Angular refreshes the appropriate binding points, which updates the +view. + +The view component is constructed by Angular from this template:  __`app/index.html`:__  <pre> -<html ng:app> -... -<body ng:controller="PhoneListCtrl"> +<html ng-app> +<head> +  ... +  <script src="lib/angular/angular.js"></script> +  <script src="js/controllers.js"></script> +</head> +<body ng-controller="PhoneListCtrl">    <ul> -    <li ng:repeat="phone in phones"> +    <li ng-repeat="phone in phones">        {{phone.name}}        <p>{{phone.snippet}}</p>      </li>    </ul> - -  <script src="lib/angular/angular.js"></script> -  <script src="js/controllers.js"></script>  </body>  </html>  </pre> -We replaced the hard-coded phone list with the {@link api/angular.widget.@ng:repeat ng:repeat -widget} and two {@link guide/dev_guide.expressions Angular expressions} enclosed in curly braces: +We replaced the hard-coded phone list with the +{@link api/angular.module.ng.$compileProvider.directive.ng-repeat ng-repeat directive} and two +{@link guide/dev_guide.expressions Angular expressions} enclosed in curly braces:  `{{phone.name}}` and `{{phone.snippet}}`: -* The `ng:repeat="phone in phones"` statement in the `<li>` tag is an Angular repeater. The +* The `ng-repeat="phone in phones"` statement in the `<li>` tag is an Angular repeater. The  repeater tells Angular to create a `<li>` element for each phone in the list using the first `<li>`  tag as the template. -      <img src="img/tutorial/tutorial_02_final.png"> - -* The curly braces around `phone.name` and `phone.snippet` are examples of {@link -guide/dev_guide.compiler.markup Angular markup}. The curly markup is shorthand for the Angular -directive {@link api/angular.directive.ng:bind ng:bind}. An `ng:bind` directive indicates a -template binding point to Angular. Binding points are locations in a template where Angular creates -data-binding between the view and the model. +* As we've learned in step 0, the curly braces around `phone.name` and `phone.snippet` denote +bindings. As opposed to evaluating constants, these expression are refering to our application +model, which was set up in our `PhoneListCtrl` controller. -In Angular, the view is a projection of the model through the HTML template. This means that -whenever the model changes, Angular refreshes the appropriate binding points, which updates the -view. +      <img src="img/tutorial/tutorial_02.png">  ## Model and Controller  The data __model__ (a simple array  of phones in object literal notation) is instantiated within -the __controller__ function(`PhoneListCtrl`): +the `PhoneListCtrl` __controller__:  __`app/js/controllers.js`:__  <pre> -function PhoneListCtrl() { -  this.phones = [{"name": "Nexus S", -                  "snippet": "Fast just got faster with Nexus S."}, -                 {"name": "Motorola XOOM™ with Wi-Fi", -                  "snippet": "The Next, Next Generation tablet."}, -                 {"name": "MOTOROLA XOOM™", -                  "snippet": "The Next, Next Generation tablet."}]; +function PhoneListCtrl($scope) { +  $scope.phones = [{"name": "Nexus S", +                    "snippet": "Fast just got faster with Nexus S."}, +                   {"name": "Motorola XOOM™ with Wi-Fi", +                    "snippet": "The Next, Next Generation tablet."}, +                   {"name": "MOTOROLA XOOM™", +                    "snippet": "The Next, Next Generation tablet."}];  }  </pre> @@ -92,10 +92,15 @@ providing context for our data model, the controller allows us to establish data  the model and the view. We connected the dots between the presentation, data, and logic components  as follows: -* The name of our controller function(in the JavaScript file `controllers.js`) matches the {@link -api/angular.directive.ng:controller ng:controller} directive in the `<body>` tag (`PhoneListCtrl`). -* The data is instantiated within the *scope* of our controller function; our template binding -points are located within the block bounded by the `<body ng:controller="PhoneListCtrl">` tag. +* `PhoneListCtrl` — the name of our controller function (located in the JavaScript file +`controllers.js`), matches the value of the +{@link api/angular.module.ng.$compileProvider.directive.ng-controller ng-controller} directive located +on the `<body>` tag. + +* The phone data is then attached to the *scope* (`$scope`) that was injected into our controller +function. The controller scope is a prototypically descendant of the root scope that was created +when the application bootstrapped. This controller scope is available to all bindings located within +the `<body ng-controller="PhoneListCtrl">` tag.    The concept of a scope in Angular is crucial; a scope can be seen as the glue which allows the  template, model and controller to work together. Angular uses scopes, along with the information @@ -118,8 +123,10 @@ describe('PhoneCat controllers', function() {    describe('PhoneListCtrl', function() {      it('should create "phones" model with 3 phones', function() { -      var ctrl = new PhoneListCtrl(); -      expect(ctrl.phones.length).toBe(3); +      var scope = {}, +          ctrl = new PhoneListCtrl(scope); + +      expect(scope.phones.length).toBe(3);      });    });  }); @@ -142,11 +149,11 @@ http://code.google.com/p/js-test-driver/ JsTestDriver}. To run the test, do the  1. In a _separate_ terminal window or tab, go to the `angular-phonecat` directory and run  `./scripts/test-server.sh` to start the test web server. -2. Open a new browser tab or window and navigate to {@link http://localhost:9876}. +2. Open a new browser window and navigate to {@link http://localhost:9876}.  3. Choose "Capture this browser in strict mode". -   At this point, you can leave this tab open and forget about it. JsTestDriver will use it to +   At this point, you can leave this window open and forget about it. JsTestDriver will use it to  execute the tests and report the results in the terminal.  4. Execute the test by running `./scripts/test.sh` @@ -160,8 +167,8 @@ execute the tests and report the results in the terminal.    Yay! The test passed! Or not... -  Note: If you see errors after you run the test, close the browser tab and go back to the terminal -and kill the script, then repeat the procedure above. +  Note: If you see errors after you run the test, close the browser window and go back to the +  terminal and kill the script, then repeat the procedure above.  # Experiments @@ -179,14 +186,14 @@ and kill the script, then repeat the procedure above.            <table>              <tr><th>row number</th></tr> -            <tr ng:repeat="i in [0, 1, 2, 3, 4, 5, 6, 7]"><td>{{i}}</td></tr> +            <tr ng-repeat="i in [0, 1, 2, 3, 4, 5, 6, 7]"><td>{{i}}</td></tr>            </table>    Now, make the list 1-based by incrementing `i` by one in the binding:            <table>              <tr><th>row number</th></tr> -            <tr ng:repeat="i in [0, 1, 2, 3, 4, 5, 6, 7]"><td>{{i+1}}</td></tr> +            <tr ng-repeat="i in [0, 1, 2, 3, 4, 5, 6, 7]"><td>{{i+1}}</td></tr>            </table>  * Make the unit test fail by changing the `toBe(3)` statement to `toBe(4)`, and rerun the diff --git a/docs/content/tutorial/step_03.ngdoc b/docs/content/tutorial/step_03.ngdoc index fef4743f..3c997337 100644 --- a/docs/content/tutorial/step_03.ngdoc +++ b/docs/content/tutorial/step_03.ngdoc @@ -32,10 +32,10 @@ We made no changes to the controller.  __`app/index.html`:__  <pre>  ... -   Fulltext Search: <input ng:model="query"/> +   Fulltext Search: <input ng-model="query">    <ul class="phones"> -    <li ng:repeat="phone in phones.$filter(query)"> +    <li ng-repeat="phone in phones | filter(query)">        {{phone.name}}        <p>{{phone.snippet}}</p>      </li> @@ -43,8 +43,9 @@ __`app/index.html`:__  ...  </pre> -We added a standard HTML `<input>` tag and used angular's {@link api/angular.module.ng.$filter.filter $filter} -function to process the input for the `ng:repeater`. +We added a standard HTML `<input>` tag and used angular's +{@link api/angular.module.ng.$filter.filter $filter} function to process the input for the +`ng-repeater`.  This lets a user enter search criteria and immediately see the effects of their search on the phone  list. This new code demonstrates the following: @@ -53,17 +54,17 @@ list. This new code demonstrates the following:  name of the input box to a variable of the same name in the data model and keeps the two in sync.    In this code, the data that a user types into the input box (named __`query`__) is immediately -available as a filter input in the list repeater (`phone in phones.$filter(`__`query`__`)`). When +available as a filter input in the list repeater (`phone in phones | filter(`__`query`__`)`). When  changes to the data model cause the repeater's input to change, the repeater efficiently updates  the DOM to reflect the current state of the model. -      <img src="img/tutorial/tutorial_03_final.png"> +      <img src="img/tutorial/tutorial_03.png"> -* Use of `$filter`. The {@link api/angular.module.ng.$filter.filter $filter} method uses the `query` value to -create a new array that contains only those records that match the `query`. +* Use of `filter` filter. The {@link api/angular.module.ng.$filter.filter filter} function uses the +`query` value to create a new array that contains only those records that match the `query`. -  `ng:repeat` automatically updates the view in response to the changing number of phones returned -by the `$filter`. The process is completely transparent to the developer. +  `ng-repeat` automatically updates the view in response to the changing number of phones returned +by the `filter` filter. The process is completely transparent to the developer.  ## Test @@ -127,23 +128,23 @@ really is that easy to set up any functional, readable, end-to-end test.    However, when you reload the page, you won't see the expected result. This is because the "query"  model lives in the scope defined by the body element: -          <body ng:controller="PhoneListCtrl"> +          <body ng-controller="PhoneListCtrl">    If you want to bind to the query model from the `<title>` element, you must __move__ the -`ng:controller` declaration to the HTML element because it is the common parent of both the body +`ng-controller` declaration to the HTML element because it is the common parent of both the body  and title elements: -          <html ng:controller="PhoneListCtrl"> +          <html ng-app ng-controller="PhoneListCtrl"> -  Be sure to *remove* the `ng:controller` declaration from the body element. +  Be sure to *remove* the `ng-controller` declaration from the body element.    While using double curlies works fine in within the title element, you might have noticed that  for a split second they are actually displayed to the user while the page is loading. A better -solution would be to use the {@link api/angular.directive.ng:bind ng:bind} or {@link -api/angular.directive.ng:bind-template ng:bind-template} directives, which are invisible to the -user while the page is loading: +solution would be to use the {@link api/angular.module.ng.$compileProvider.directive.ng-bind +ng-bind} or {@link api/angular.module.ng.$compileProvider.directive.ng-bind-template +ng-bind-template} directives, which are invisible to the user while the page is loading: -          <title ng:bind-template="Google Phone Gallery: {{query}}">Google Phone Gallery</title> +          <title ng-bind-template="Google Phone Gallery: {{query}}">Google Phone Gallery</title>  * Add the following end-to-end test into the `describe` block within `test/e2e/scenarios.js`: diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index a5fefd74..ebeb7cca 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 4 - Two-way Data Binding  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="4"></ul> diff --git a/docs/content/tutorial/step_05.ngdoc b/docs/content/tutorial/step_05.ngdoc index 7bf6f708..a19deed6 100644 --- a/docs/content/tutorial/step_05.ngdoc +++ b/docs/content/tutorial/step_05.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 5 - XHRs & Dependency Injection  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="5"></ul> diff --git a/docs/content/tutorial/step_06.ngdoc b/docs/content/tutorial/step_06.ngdoc index 45e667de..0cd721d3 100644 --- a/docs/content/tutorial/step_06.ngdoc +++ b/docs/content/tutorial/step_06.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 6 - Templating Links & Images  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="6"></ul> diff --git a/docs/content/tutorial/step_07.ngdoc b/docs/content/tutorial/step_07.ngdoc index 0aebb9fe..1cef6f83 100644 --- a/docs/content/tutorial/step_07.ngdoc +++ b/docs/content/tutorial/step_07.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 7 - Routing & Multiple Views  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="7"></ul> diff --git a/docs/content/tutorial/step_08.ngdoc b/docs/content/tutorial/step_08.ngdoc index a81c689b..ad206452 100644 --- a/docs/content/tutorial/step_08.ngdoc +++ b/docs/content/tutorial/step_08.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 8 - More Templating  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="8"></ul> diff --git a/docs/content/tutorial/step_09.ngdoc b/docs/content/tutorial/step_09.ngdoc index c0df9e1f..f4aa010a 100644 --- a/docs/content/tutorial/step_09.ngdoc +++ b/docs/content/tutorial/step_09.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 9 - Filters  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="9"></ul> diff --git a/docs/content/tutorial/step_10.ngdoc b/docs/content/tutorial/step_10.ngdoc index 73e8b354..dd31da82 100644 --- a/docs/content/tutorial/step_10.ngdoc +++ b/docs/content/tutorial/step_10.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 10 - Event Handlers  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="10"></ul> diff --git a/docs/content/tutorial/step_11.ngdoc b/docs/content/tutorial/step_11.ngdoc index c6b70065..e2826805 100644 --- a/docs/content/tutorial/step_11.ngdoc +++ b/docs/content/tutorial/step_11.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: 11 - REST and Custom Services  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  <ul doc:tutorial-nav="11"></ul> diff --git a/docs/content/tutorial/the_end.ngdoc b/docs/content/tutorial/the_end.ngdoc index ed6eda97..f392452e 100644 --- a/docs/content/tutorial/the_end.ngdoc +++ b/docs/content/tutorial/the_end.ngdoc @@ -2,6 +2,8 @@  @name Tutorial: The End  @description +<h2 style="color: red">This page has not been updated for AngularJS 1.0 yet</h2> +  Our application is now complete. Feel free to experiment with the code further, and jump back to  previous steps using the `git checkout` or `goto_step.sh` commands. diff --git a/docs/img/tutorial/tutorial_00.png b/docs/img/tutorial/tutorial_00.pngBinary files differ new file mode 100644 index 00000000..65f3973e --- /dev/null +++ b/docs/img/tutorial/tutorial_00.png diff --git a/docs/img/tutorial/tutorial_02.png b/docs/img/tutorial/tutorial_02.pngBinary files differ new file mode 100644 index 00000000..b4c1cab1 --- /dev/null +++ b/docs/img/tutorial/tutorial_02.png diff --git a/docs/img/tutorial/tutorial_02_final.png b/docs/img/tutorial/tutorial_02_final.pngBinary files differ deleted file mode 100644 index e9b41f8f..00000000 --- a/docs/img/tutorial/tutorial_02_final.png +++ /dev/null diff --git a/docs/img/tutorial/tutorial_03.png b/docs/img/tutorial/tutorial_03.pngBinary files differ new file mode 100644 index 00000000..3e432a35 --- /dev/null +++ b/docs/img/tutorial/tutorial_03.png diff --git a/docs/img/tutorial/tutorial_03_final.png b/docs/img/tutorial/tutorial_03_final.pngBinary files differ deleted file mode 100644 index e5acdc2b..00000000 --- a/docs/img/tutorial/tutorial_03_final.png +++ /dev/null diff --git a/docs/src/templates/doc_widgets.js b/docs/src/templates/doc_widgets.js index 50de4ed3..bf49697d 100644 --- a/docs/src/templates/doc_widgets.js +++ b/docs/src/templates/doc_widgets.js @@ -291,14 +291,14 @@ angular.module('ngdocs.directives', [], function($compileProvider) {          } else {            prevStep = 'step_' + pad(step - 1);            nextStep = 'step_'  + pad(step + 1); -          codeDiff = 'step-' + step + '...step-' + step; +          codeDiff = 'step-' + (step-1) + '...step-' + step;          }          content = angular.element( -          '<li><a href="#!/tutorial/' + prevStep + '">Previous</a></li>' + +          '<li><a href="tutorial/' + prevStep + '">Previous</a></li>' +            '<li><a href="http://angular.github.com/angular-phonecat/step-' + step + '/app">Live Demo</a></li>' +            '<li><a href="https://github.com/angular/angular-phonecat/compare/' + codeDiff + '">Code Diff</a></li>' + -          '<li><a href="#!/tutorial/' + nextStep + '">Next</a></li>' +          '<li><a href="tutorial/' + nextStep + '">Next</a></li>'          );          element.attr('id', 'tutorial-nav'); diff --git a/docs/src/templates/docs.css b/docs/src/templates/docs.css index ee8eaaef..adf74ba0 100644 --- a/docs/src/templates/docs.css +++ b/docs/src/templates/docs.css @@ -518,3 +518,24 @@ td.empty-corner-lt {  .even {    background-color: #d3d3d3;  } + +/* tutorial */ + +#content .tutorial-start { +  -moz-border-radius:8px; +  -webkit-border-radius: 8px; +  border-radius: 8px; + +  background-color: #7989D6; +  padding: 10px; +  margin-left: 43%; +  width: 100px; +  color: #fff; +  font-weight: bold; + +} + +#content .tutorial-start:hover { +  color: #000; +} + diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 9d91c233..b82ba660 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -133,14 +133,14 @@ SyntaxHighlighter['defaults'].gutter = true;   * @param $cookieStore   * @constructor   */ -function TutorialInstructionsCtrl($cookieStore) { -  this.selected = $cookieStore.get('selEnv') || 'git-mac'; +function TutorialInstructionsCtrl($scope, $cookieStore) { +  $scope.selected = $cookieStore.get('selEnv') || 'git-mac'; -  this.currentCls = function(id, cls) { +  $scope.currentCls = function(id, cls) {      return this.selected == id  ? cls || 'current' : '';    }; -  this.select = function(id) { +  $scope.select = function(id) {      this.selected = id;      $cookieStore.put('selEnv', id);    }; diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index bb8d2f1e..794b3418 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -98,7 +98,7 @@      <ul id="navbar">        <li><a href="http://angularjs.org/">AngularJS</a></li>        <li><a href="misc/started" ng:class="selectedSection('misc')">Getting Started</a></li> -      <!-- <li><a href="tutorial" ng:class="selectedSection('tutorial')">Tutorial</a></li> --> +      <li><a href="tutorial" ng:class="selectedSection('tutorial')">Tutorial</a></li>        <li><a href="api" ng:class="selectedSection('api')">API Reference</a></li>        <li><a href="cookbook" ng:class="selectedSection('cookbook')">Examples</a></li>        <li><a href="guide" ng:class="selectedSection('guide')">Developer Guide</a></li> | 
