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 --- src/ng/compile.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/ng/compile.js') diff --git a/src/ng/compile.js b/src/ng/compile.js index 219f99ae..dd8d001c 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -50,7 +50,7 @@ * * Here's an example directive declared with a Directive Definition Object: * - *
+ * ```js
  *   var myModule = angular.module(...);
  *
  *   myModule.directive('directiveName', function factory(injectables) {
@@ -83,7 +83,7 @@
  *     };
  *     return directiveDefinitionObject;
  *   });
- * 
+ * ``` * *
* **Note:** Any unspecified options will use the default value. You can see the default values below. @@ -91,7 +91,7 @@ * * Therefore the above can be simplified as: * - *
+ * ```js
  *   var myModule = angular.module(...);
  *
  *   myModule.directive('directiveName', function factory(injectables) {
@@ -102,7 +102,7 @@
  *     // or
  *     // return function postLink(scope, iElement, iAttrs) { ... }
  *   });
- * 
+ * ``` * * * @@ -256,9 +256,9 @@ * * #### `compile` * - *
+ * ```js
  *   function compile(tElement, tAttrs, transclude) { ... }
- * 
+ * ``` * * The compile function deals with transforming the template DOM. Since most directives do not do * template transformation, it is not used often. Examples that require compile functions are @@ -301,9 +301,9 @@ * #### `link` * This property is used only if the `compile` property is not defined. * - *
+ * ```js
  *   function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }
- * 
+ * ``` * * The link function is responsible for registering DOM listeners as well as updating the DOM. It is * executed after the template has been cloned. This is where most of the directive logic will be @@ -361,7 +361,7 @@ * the only way to easily get the actual value because during the linking phase the interpolation * hasn't been evaluated yet and so the value is at this time set to `undefined`. * - *
+ * ```js
  * function linkingFn(scope, elm, attrs, ctrl) {
  *   // get the attribute value
  *   console.log(attrs.ngModel);
@@ -374,7 +374,7 @@
  *     console.log('ngModel has changed value to ' + value);
  *   });
  * }
- * 
+ * ``` * * Below is an example using `$compileProvider`. * @@ -465,14 +465,14 @@ * * - If you are not asking the linking function to clone the template, create the DOM element(s) * before you send them to the compiler and keep this reference around. - *
+ *   ```js
  *     var element = $compile('

{{total}}

')(scope); - *
+ * ``` * * - if on the other hand, you need the element to be cloned, the view reference from the original * example would not point to the clone, but rather to the original template that was cloned. In * this case, you can access the clone via the cloneAttachFn: - *
+ *   ```js
  *     var templateElement = angular.element('

{{total}}

'), * scope = ....; * @@ -481,7 +481,7 @@ * }); * * //now we have reference to the cloned DOM via `clonedElement` - *
+ * ``` * * * For information on how the compiler works, see the -- cgit v1.2.3