From f7d28cd377f06224247b950680517a187a7b6749 Mon Sep 17 00:00:00 2001 From: Caitlin Potter Date: Thu, 6 Feb 2014 14:02:18 +0000 Subject: docs(all): convert
/
snippets to GFM snippets --- docs/content/tutorial/step_00.ngdoc | 5 ++-- docs/content/tutorial/step_01.ngdoc | 5 ++-- docs/content/tutorial/step_02.ngdoc | 20 ++++++++----- docs/content/tutorial/step_03.ngdoc | 14 +++++---- docs/content/tutorial/step_04.ngdoc | 20 ++++++++----- docs/content/tutorial/step_05.ngdoc | 44 ++++++++++++++++----------- docs/content/tutorial/step_06.ngdoc | 15 ++++++---- docs/content/tutorial/step_07.ngdoc | 34 ++++++++++++--------- docs/content/tutorial/step_08.ngdoc | 25 +++++++++------- docs/content/tutorial/step_09.ngdoc | 25 +++++++++------- docs/content/tutorial/step_10.ngdoc | 15 ++++++---- docs/content/tutorial/step_11.ngdoc | 25 +++++++++------- docs/content/tutorial/step_12.ngdoc | 59 +++++++++++++++++++++---------------- 13 files changed, 181 insertions(+), 125 deletions(-) (limited to 'docs/content/tutorial') diff --git a/docs/content/tutorial/step_00.ngdoc b/docs/content/tutorial/step_00.ngdoc index b6ea975c..22bbe158 100644 --- a/docs/content/tutorial/step_00.ngdoc +++ b/docs/content/tutorial/step_00.ngdoc @@ -77,7 +77,8 @@ The HTML page that displays "Nothing here yet!" was constructed with the HTML co The code contains some key Angular elements that we will need as we progress. __`app/index.html`:__ -
+
+```html
 
 
 
@@ -93,7 +94,7 @@ __`app/index.html`:__
 
 
 
-
+``` diff --git a/docs/content/tutorial/step_01.ngdoc b/docs/content/tutorial/step_01.ngdoc index 540484d3..d3f28929 100644 --- a/docs/content/tutorial/step_01.ngdoc +++ b/docs/content/tutorial/step_01.ngdoc @@ -21,7 +21,8 @@ The page now contains a list with information about two phones. The most important changes are listed below. You can see the full diff on [GitHub](https://github.com/angular/angular-phonecat/compare/step-0...step-1): __`app/index.html`:__ -
+
+```html
   
-
+``` # Experiments diff --git a/docs/content/tutorial/step_02.ngdoc b/docs/content/tutorial/step_02.ngdoc index 99180b4b..efafba91 100644 --- a/docs/content/tutorial/step_02.ngdoc +++ b/docs/content/tutorial/step_02.ngdoc @@ -32,7 +32,8 @@ view. The view component is constructed by Angular from this template: __`app/index.html`:__ -
+
+```html
 
 
   ...
@@ -50,7 +51,7 @@ __`app/index.html`:__
 
 
 
-
+``` We replaced the hard-coded phone list with the {@link api/ng.directive:ngRepeat ngRepeat directive} and two @@ -77,7 +78,8 @@ the `PhoneListCtrl` __controller__. The __controller__ is simply a constructor f `$scope` parameter: __`app/js/controllers.js`:__ -
+
+```js
 
 var phonecatApp = angular.module('phonecatApp', []);
 
@@ -92,7 +94,7 @@ phonecatApp.controller('PhoneListCtrl', function ($scope) {
   ];
 });
 
-
+``` Here we declared a controller called `PhoneListCtrl` and registered it in an AngularJS module, `phonecatApp`. Notice that our `ng-app` directive (on the `` tag) now specifies the `phonecatApp` @@ -130,7 +132,8 @@ developed. If our controller is available on the global namespace then we can si with a mock `scope` object. Take a look at the following unit test for our controller: __`test/unit/controllersSpec.js`:__ -
+
+```js
 describe('PhoneCat controllers', function() {
 
   describe('PhoneListCtrl', function(){
@@ -143,7 +146,7 @@ describe('PhoneCat controllers', function() {
     });
   });
 });
-
+``` The test instantiates `PhoneListCtrl` and verifies that the phones array property on the scope contains three records. This example demonstrates how easy it is to create a unit test for code in @@ -157,7 +160,8 @@ service, `$controller`, which will retrieve your controller by name. Here is th `$controller`: __`test/unit/controllersSpec.js`:__ -
+
+```js
 describe('PhoneCat controllers', function() {
   beforeEach(module('phonecatApp'));
 
@@ -171,7 +175,7 @@ describe('PhoneCat controllers', function() {
     }));
   });
 });
-
+``` Don't forget that we need to load up the `phonecatApp` module into the test so that the controller is available to be injected. diff --git a/docs/content/tutorial/step_03.ngdoc b/docs/content/tutorial/step_03.ngdoc index d7c75086..8866e49c 100644 --- a/docs/content/tutorial/step_03.ngdoc +++ b/docs/content/tutorial/step_03.ngdoc @@ -30,7 +30,8 @@ We made no changes to the controller. ## Template __`app/index.html`:__ -
+
+```html
   
@@ -52,7 +53,7 @@ __`app/index.html`:__
-
+``` We added a standard HTML `` tag and used Angular's {@link api/ng.filter:filter filter} function to process the input for the @@ -88,7 +89,8 @@ The search feature was fully implemented via templates and data-binding, so we'l end-to-end test, to verify that the feature works. __`test/e2e/scenarios.js`:__ -
+
+```js
 describe('PhoneCat App', function() {
 
   describe('Phone list view', function() {
@@ -109,7 +111,7 @@ describe('PhoneCat App', function() {
     });
   });
 });
-
+``` Even though the syntax of this test looks very much like our controller unit test written with Jasmine, the end-to-end test uses APIs of {@link guide/dev_guide.e2e-testing Angular's end-to-end @@ -168,7 +170,7 @@ ngBindTemplate} directives, which are invisible to the user while the page is lo * Add the following end-to-end test into the `describe` block within `test/e2e/scenarios.js`: -
+  ```js
     it('should display the current filter value within an element with id "status"',
         function() {
       expect(element('#status').text()).toMatch(/Current filter: \s*$/);
@@ -180,7 +182,7 @@ ngBindTemplate} directives, which are invisible to the user while the page is lo
       //alternative version of the last assertion that tests just the value of the binding
       using('#status').expect(binding('query')).toBe('nexus');
     });
-  
+ ``` Refresh the browser tab with the end-to-end test runner to see the test fail. To make the test pass, edit the `index.html` template to add a `div` or `p` element with `id` `"status"` and content diff --git a/docs/content/tutorial/step_04.ngdoc b/docs/content/tutorial/step_04.ngdoc index 612619a4..adf362b6 100644 --- a/docs/content/tutorial/step_04.ngdoc +++ b/docs/content/tutorial/step_04.ngdoc @@ -24,7 +24,8 @@ The most important differences between Steps 3 and 4 are listed below. You can s ## Template __`app/index.html`:__ -
+
+```html
   Search: 
   Sort by: