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/guide/module.ngdoc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'docs/content/guide/module.ngdoc') diff --git a/docs/content/guide/module.ngdoc b/docs/content/guide/module.ngdoc index 8bf0eba6..417d3837 100644 --- a/docs/content/guide/module.ngdoc +++ b/docs/content/guide/module.ngdoc @@ -126,7 +126,7 @@ of blocks: application. Only instances and constants can be injected into run blocks. This is to prevent further system configuration during application run time. -
+```js
 angular.module('myModule', []).
   config(function(injectables) { // provider-injector
     // This is an example of config block.
@@ -140,14 +140,14 @@ angular.module('myModule', []).
     // You can only inject instances (not Providers)
     // into the run blocks
   });
-
+``` ## Configuration Blocks There are some convenience methods on the module which are equivalent to the config block. For example: -
+```js
 angular.module('myModule', []).
   value('a', 123).
   factory('a', function() { return 123; }).
@@ -163,7 +163,7 @@ angular.module('myModule', []).
     $compileProvider.directive('directiveName', ...);
     $filterProvider.register('filterName', ...);
   });
-
+``` The configuration blocks get applied in the order in which they are registered. The only exception to it are constant definitions, which are placed at the beginning of all configuration blocks. @@ -196,7 +196,7 @@ and thus script loaders can take advantage of this property and parallelize the Beware that using `angular.module('myModule', [])` will create the module `myModule` and overwrite any existing module named `myModule`. Use `angular.module('myModule')` to retrieve an existing module. -
+```js
   var myModule = angular.module('myModule', []);
   
   // add some directives and services
@@ -208,7 +208,7 @@ existing module named `myModule`. Use `angular.module('myModule')` to retrieve a
 
   // throws an error because myOtherModule has yet to be defined
   var myModule = angular.module('myOtherModule');
-
+``` # Unit Testing @@ -219,7 +219,8 @@ injector, which means that the modules are loaded multiple times per VM. Properl modules can help with unit testing, as in this example: In all of these examples we are going to assume this module definition: -
+
+```js
   angular.module('greetMod', []).
 
     factory('alert', function($window) {
@@ -235,10 +236,11 @@ In all of these examples we are going to assume this module definition:
         alert(salutation + ' ' + name + '!');
       }
     });
-
+``` Let's write some tests: -
+
+```js
 describe('myApp', function() {
   // load the relevant application modules then load a special
   // test module which overrides the $window with a mock version,
@@ -272,4 +274,4 @@ describe('myApp', function() {
     });
   });
 });
-
+``` -- cgit v1.2.3