From 57c43dd3762ea665125bff7e4727bce06a225b32 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 22 Aug 2013 12:32:42 -0700 Subject: docs(module): improve the installation instructions for optional modules Currently, the documentation does a bad job of explaining the distinction between the services that it provides, and the module itself. Furthermore, the instructions for using optional modules are inconsistent or missing. This commit addresses the problem by ading a new `{@installModule foo}` annotation to the docs generator that inlines the appropriate instructions based on the name of the module. --- src/ngSanitize/filter/linky.js | 6 ++++-- src/ngSanitize/sanitize.js | 21 +++++---------------- 2 files changed, 9 insertions(+), 18 deletions(-) (limited to 'src/ngSanitize') diff --git a/src/ngSanitize/filter/linky.js b/src/ngSanitize/filter/linky.js index cc0f7aa6..282a6117 100644 --- a/src/ngSanitize/filter/linky.js +++ b/src/ngSanitize/filter/linky.js @@ -4,8 +4,10 @@ * @function * * @description - * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and - * plain email address links. + * Finds links in text input and turns them into html links. Supports http/https/ftp/mailto and + * plain email address links. + * + * Requires the {@link ngSanitize `ngSanitize`} module to be installed. * * @param {string} text Input text. * @param {string} target Window (_blank|_self|_parent|_top) or named frame to open links in. diff --git a/src/ngSanitize/sanitize.js b/src/ngSanitize/sanitize.js index 8220b1f5..3d904ad1 100644 --- a/src/ngSanitize/sanitize.js +++ b/src/ngSanitize/sanitize.js @@ -6,25 +6,14 @@ var $sanitizeMinErr = angular.$$minErr('$sanitize'); * @ngdoc overview * @name ngSanitize * @description - * - * The `ngSanitize` module provides functionality to sanitize HTML. - * - * # Installation - * As a separate module, it must be loaded after Angular core is loaded; otherwise, an 'Uncaught Error: - * No module: ngSanitize' runtime error will occur. * - *
- * - * - *+ * # ngSanitize + * + * The `ngSanitize` module provides functionality to sanitize HTML. * - * # Usage - * To make sure the module is available to your application, declare it as a dependency of you application - * module. + * {@installModule sanitize} * - *
- * angular.module('app', ['ngSanitize']);
- *
+ * See {@link ngSanitize.$sanitize `$sanitize`} for usage.
*/
/*
--
cgit v1.2.3