EVOLUTION-MANAGER
Edit File: $compileProvider.html
<a href='https://github.com/angular/angular.js/edit/v1.3.x/src/ng/compile.js?message=docs($compileProvider)%3A%20describe%20your%20change...#L695' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit"> </i>Improve this Doc</a> <a href='https://github.com/angular/angular.js/tree/v1.3.9/src/ng/compile.js#L695' class='view-source pull-right btn btn-primary'> <i class="glyphicon glyphicon-zoom-in"> </i>View Source </a> <header class="api-profile-header"> <h1 class="api-profile-header-heading">$compileProvider</h1> <ol class="api-profile-header-structure naked-list step-list"> <li> <a href="api/ng/service/$compile">- $compile</a> </li> <li> - provider in module <a href="api/ng">ng</a> </li> </ol> </header> <div class="api-profile-description"> </div> <div> <h2>Methods</h2> <ul class="methods"> <li id="directive"> <h3><p><code>directive(name, directiveFactory);</code></p> </h3> <div><p>Register a new directive with the compiler.</p> </div> <h4>Parameters</h4> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> name </td> <td> <a href="" class="label type-hint type-hint-string">string</a><a href="" class="label type-hint type-hint-object">Object</a> </td> <td> <p>Name of the directive in camel-case (i.e. <code>ngBind</code> which will match as <code>ng-bind</code>), or an object map of directives where the keys are the names and the values are the factories.</p> </td> </tr> <tr> <td> directiveFactory </td> <td> <a href="" class="label type-hint type-hint-function">function()</a><a href="" class="label type-hint type-hint-array">Array</a> </td> <td> <p>An injectable directive factory function. See <a href="guide/directive">directive</a> for more info.</p> </td> </tr> </tbody> </table> <h4>Returns</h4> <table class="variables-matrix return-arguments"> <tr> <td><a href="" class="label type-hint type-hint-ng">ng.$compileProvider</a></td> <td><p>Self for chaining.</p> </td> </tr> </table> </li> <li id="aHrefSanitizationWhitelist"> <h3><p><code>aHrefSanitizationWhitelist([regexp]);</code></p> </h3> <div><p>Retrieves or overrides the default regular expression that is used for whitelisting of safe urls during a[href] sanitization.</p> <p>The sanitization is a security measure aimed at preventing XSS attacks via html links.</p> <p>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 <code>aHrefSanitizationWhitelist</code> regular expression. If a match is found, the original url is written into the dom. Otherwise, the absolute url is prefixed with <code>'unsafe:'</code> string and only then is it written into the DOM.</p> </div> <h4>Parameters</h4> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> regexp <div><em>(optional)</em></div> </td> <td> <a href="" class="label type-hint type-hint-regexp">RegExp</a> </td> <td> <p>New regexp to whitelist urls with.</p> </td> </tr> </tbody> </table> <h4>Returns</h4> <table class="variables-matrix return-arguments"> <tr> <td><a href="" class="label type-hint type-hint-regexp">RegExp</a><a href="" class="label type-hint type-hint-ng">ng.$compileProvider</a></td> <td><p>Current RegExp if called without value or self for chaining otherwise.</p> </td> </tr> </table> </li> <li id="imgSrcSanitizationWhitelist"> <h3><p><code>imgSrcSanitizationWhitelist([regexp]);</code></p> </h3> <div><p>Retrieves or overrides the default regular expression that is used for whitelisting of safe urls during img[src] sanitization.</p> <p>The sanitization is a security measure aimed at prevent XSS attacks via html links.</p> <p>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 <code>imgSrcSanitizationWhitelist</code> regular expression. If a match is found, the original url is written into the dom. Otherwise, the absolute url is prefixed with <code>'unsafe:'</code> string and only then is it written into the DOM.</p> </div> <h4>Parameters</h4> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> regexp <div><em>(optional)</em></div> </td> <td> <a href="" class="label type-hint type-hint-regexp">RegExp</a> </td> <td> <p>New regexp to whitelist urls with.</p> </td> </tr> </tbody> </table> <h4>Returns</h4> <table class="variables-matrix return-arguments"> <tr> <td><a href="" class="label type-hint type-hint-regexp">RegExp</a><a href="" class="label type-hint type-hint-ng">ng.$compileProvider</a></td> <td><p>Current RegExp if called without value or self for chaining otherwise.</p> </td> </tr> </table> </li> <li id="debugInfoEnabled"> <h3><p><code>debugInfoEnabled([enabled]);</code></p> </h3> <div><p>Call this method to enable/disable various debug runtime information in the compiler such as adding binding information and a reference to the current scope on to DOM elements. If enabled, the compiler will add the following to DOM elements that have been bound to the scope</p> <ul> <li><code>ng-binding</code> CSS class</li> <li><code>$binding</code> data property containing an array of the binding expressions</li> </ul> <p>You may want to disable this in production for a significant performance boost. See <a href="guide/production#disabling-debug-data">Disabling Debug Data</a> for more.</p> <p>The default value is true.</p> </div> <h4>Parameters</h4> <table class="variables-matrix input-arguments"> <thead> <tr> <th>Param</th> <th>Type</th> <th>Details</th> </tr> </thead> <tbody> <tr> <td> enabled <div><em>(optional)</em></div> </td> <td> <a href="" class="label type-hint type-hint-boolean">boolean</a> </td> <td> <p>update the debugInfoEnabled state if provided, otherwise just return the current debugInfoEnabled state</p> </td> </tr> </tbody> </table> <h4>Returns</h4> <table class="variables-matrix return-arguments"> <tr> <td><a href="" class="label type-hint type-hint-object">*</a></td> <td><p>current value if used as getter or itself (chaining) if used as setter</p> </td> </tr> </table> </li> </ul> </div>