$compileProvider();
Register a new directive with the compiler.
Param | Type | Details |
---|---|---|
name | string Object | Name of the directive in camel-case (i.e. |
directiveFactory | function() Array | An injectable directive factory function. See directive for more info. |
ng.$compileProvider |
Self for chaining. |
Retrieves or overrides the default regular expression that is used for whitelisting of safe urls during a[href] sanitization.
The sanitization is a security measure aimed at prevent XSS attacks via html links.
Any url about to be assigned to a[href] via data-binding is first normalized and turned into an absolute url. Afterwards, the url is matched against the aHrefSanitizationWhitelist
regular expression. If a match is found, the original url is written into the dom. Otherwise, the absolute url is prefixed with 'unsafe:'
string and only then is it written into the DOM.
Param | Type | Details |
---|---|---|
regexp (optional) | RegExp | New regexp to whitelist urls with. |
RegExp ng.$compileProvider
|
Current RegExp if called without value or self for chaining otherwise. |
Retrieves or overrides the default regular expression that is used for whitelisting of safe urls during img[src] sanitization.
The sanitization is a security measure aimed at prevent XSS attacks via html links.
Any url about to be assigned to img[src] via data-binding is first normalized and turned into an absolute url. Afterwards, the url is matched against the imgSrcSanitizationWhitelist
regular expression. If a match is found, the original url is written into the dom. Otherwise, the absolute url is prefixed with 'unsafe:'
string and only then is it written into the DOM.
Param | Type | Details |
---|---|---|
regexp (optional) | RegExp | New regexp to whitelist urls with. |
RegExp ng.$compileProvider
|
Current RegExp if called without value or self for chaining otherwise. |
© 2010–2016 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://code.angularjs.org/1.2.32/docs/api/ng/provider/$compileProvider