aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/ngCsp.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/directive/ngCsp.js')
-rw-r--r--src/ng/directive/ngCsp.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ng/directive/ngCsp.js b/src/ng/directive/ngCsp.js
new file mode 100644
index 00000000..d4a3a45d
--- /dev/null
+++ b/src/ng/directive/ngCsp.js
@@ -0,0 +1,26 @@
+'use strict';
+
+/**
+ * TODO(i): this directive is not publicly documented until we know for sure that CSP can't be
+ * safely feature-detected.
+ *
+ * @name angular.module.ng.$compileProvider.directive.ngCsp
+ * @priority 1000
+ *
+ * @description
+ * Enables CSP (Content Security Protection) support. This directive should be used on the `<html>`
+ * element before any kind of interpolation or expression is processed.
+ *
+ * If enabled the performance of $parse will suffer.
+ *
+ * @element html
+ */
+
+var ngCspDirective = ['$sniffer', function($sniffer) {
+ return {
+ priority: 1000,
+ compile: function() {
+ $sniffer.csp = true;
+ }
+ };
+}];