63 lines
4.5 KiB
HTML
Executable file
63 lines
4.5 KiB
HTML
Executable file
<a href="http://github.com/angular/angular.js/tree/v1.2.0rc1/src/ng/interpolate.js#L5" class="view-source btn btn-action"><i class="icon-zoom-in"> </i> View source</a><a href="http://github.com/angular/angular.js/edit/master/src/ng/interpolate.js" class="improve-docs btn btn-primary"><i class="icon-edit"> </i> Improve this doc</a><h1><code ng:non-bindable="">$interpolateProvider</code>
|
|
<div><span class="hint">service in module <code ng:non-bindable="">ng</code>
|
|
</span>
|
|
</div>
|
|
</h1>
|
|
<div><h2 id="Description">Description</h2>
|
|
<div class="description"><div class="ng-interpolateprovider-page"><p>Used for configuring the interpolation markup. Defaults to <code>{{</code> and <code>}}</code>.</p>
|
|
</div></div>
|
|
<div class="member method"><h2 id="Methods">Methods</h2>
|
|
<ul class="methods"><li><h3 id="endSymbol">endSymbol(value)</h3>
|
|
<div class="endsymbol"><div class="ng-interpolateprovider-endsymbol-page"><p>Symbol to denote the end of expression in the interpolated string. Defaults to <code>}}</code>.</p>
|
|
</div><h5 id="parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>value <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="ng-interpolateprovider-endsymbol-page"><p>new value to set the ending symbol to.</p>
|
|
</div></td></tr></tbody></table><h5 id="returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">string|self</a></td><td><div class="ng-interpolateprovider-endsymbol-page"><p>Returns the symbol when used as getter and self if used as setter.</p>
|
|
</div></td></tr></table></div>
|
|
</li>
|
|
<li><h3 id="startSymbol">startSymbol(value)</h3>
|
|
<div class="startsymbol"><div class="ng-interpolateprovider-startsymbol-page"><p>Symbol to denote start of expression in the interpolated string. Defaults to <code>{{</code>.</p>
|
|
</div><h5 id="parameters">Parameters</h5><table class="variables-matrix table table-bordered table-striped"><thead><tr><th>Param</th><th>Type</th><th>Details</th></tr></thead><tbody><tr><td>value <div><em>(optional)</em></div></td><td><a href="" class="label type-hint type-hint-string">string</a></td><td><div class="ng-interpolateprovider-startsymbol-page"><p>new value to set the starting symbol to.</p>
|
|
</div></td></tr></tbody></table><h5 id="returns">Returns</h5><table class="variables-matrix"><tr><td><a href="" class="label type-hint type-hint-string">string|self</a></td><td><div class="ng-interpolateprovider-startsymbol-page"><p>Returns the symbol when used as getter and self if used as setter.</p>
|
|
</div></td></tr></table></div>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<h2 id="Example">Example</h2>
|
|
<div class="example"><div class="ng-interpolateprovider-page"><h4>Source</h2>
|
|
<div source-edit="customInterpolationApp" source-edit-deps="angular.js script.js" source-edit-html="index.html-130" source-edit-css="" source-edit-js="script.js-129" source-edit-json="" source-edit-unit="" source-edit-scenario="scenario.js-131"></div>
|
|
<div class="tabbable"><div class="tab-pane" title="index.html">
|
|
<pre class="prettyprint linenums" ng-set-text="index.html-130" ng-html-wrap="customInterpolationApp angular.js script.js"></pre>
|
|
<script type="text/ng-template" id="index.html-130">
|
|
|
|
<div ng-app="App" ng-controller="DemoController as demo">
|
|
//demo.label//
|
|
</div>
|
|
</script>
|
|
</div>
|
|
<div class="tab-pane" title="script.js">
|
|
<pre class="prettyprint linenums" ng-set-text="script.js-129"></pre>
|
|
<script type="text/ng-template" id="script.js-129">
|
|
var customInterpolationApp = angular.module('customInterpolationApp', []);
|
|
|
|
customInterpolationApp.config(function($interpolateProvider) {
|
|
$interpolateProvider.startSymbol('//');
|
|
$interpolateProvider.endSymbol('//');
|
|
});
|
|
|
|
|
|
customInterpolationApp.controller('DemoController', function DemoController() {
|
|
this.label = "This bindings is brought you you by // interpolation symbols.";
|
|
});
|
|
</script>
|
|
</div>
|
|
<div class="tab-pane" title="End to end test">
|
|
<pre class="prettyprint linenums" ng-set-text="scenario.js-131"></pre>
|
|
<script type="text/ng-template" id="scenario.js-131">
|
|
it('should interpolate binding with custom symbols', function() {
|
|
expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.');
|
|
});
|
|
</script>
|
|
</div>
|
|
</div><h2>Demo</h4>
|
|
<div class="well doc-example-live animate-container" ng-embed-app="customInterpolationApp" ng-set-html="index.html-130" ng-eval-javascript="script.js-129"></div>
|
|
</div></div>
|
|
</div>
|