aboutsummaryrefslogtreecommitdiffstats
path: root/src/directives.js
diff options
context:
space:
mode:
authorIgor Minar2012-03-07 16:17:23 -0800
committerIgor Minar2012-03-08 11:06:14 -0800
commit772ddb983b06058ecfae46700641927183820a36 (patch)
treebe48ef6d1bf3a113f9d60da358bacc794b3322a1 /src/directives.js
parent7f6c1093f5691bee2fbddca63879d1660620bf2e (diff)
downloadangular.js-772ddb983b06058ecfae46700641927183820a36.tar.bz2
docs(directive, module): add various missing docs and fix existing docs
Diffstat (limited to 'src/directives.js')
-rw-r--r--src/directives.js31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/directives.js b/src/directives.js
index 1fc7f1b5..91241a16 100644
--- a/src/directives.js
+++ b/src/directives.js
@@ -196,6 +196,22 @@ var ngBindDirective = ngDirective(function(scope, element, attr) {
});
});
+
+/**
+ * @ngdoc directive
+ * @name angular.module.ng.$compileProvider.directive.ng:bind-html-unsafe
+ *
+ * @description
+ * Creates a binding that will innerHTML the result of evaluating the `expression` into the current
+ * element. *The innerHTML-ed content will not be sanitized!* You should use this directive only if
+ * {@link angular.module.ng.$compileProvider.directive.ng:bind-html ng:bind-html} directive is too
+ * restrictive and when you absolutely trust the source of the content you are binding to.
+ *
+ * See {@link angular.module.ng.$sanitize $sanitize} docs for examples.
+ *
+ * @element ANY
+ * @param {expression} expression {@link guide/dev_guide.expressions Expression} to evaluate.
+ */
var ngBindHtmlUnsafeDirective = ngDirective(function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtmlUnsafe);
scope.$watch(attr.ngBindHtmlUnsafe, function(value) {
@@ -203,6 +219,21 @@ var ngBindHtmlUnsafeDirective = ngDirective(function(scope, element, attr) {
});
});
+
+/**
+ * @ngdoc directive
+ * @name angular.module.ng.$compileProvider.directive.ng:bind-html
+ *
+ * @description
+ * Creates a binding that will sanitize the result of evaluating the `expression` with the
+ * {@link angular.module.ng.$sanitize $sanitize} service and innerHTML the result into the current
+ * element.
+ *
+ * See {@link angular.module.ng.$sanitize $sanitize} docs for examples.
+ *
+ * @element ANY
+ * @param {expression} expression {@link guide/dev_guide.expressions Expression} to evaluate.
+ */
var ngBindHtmlDirective = ['$sanitize', function($sanitize) {
return function(scope, element, attr) {
element.addClass('ng-binding').data('$binding', attr.ngBindHtml);