Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 680b817

Browse files
committed
docs($interpolate): fix example for provider w/ custom symbols
1 parent 5e45fd4 commit 680b817

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

src/ng/interpolate.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,32 @@ var $interpolateMinErr = minErr('$interpolate');
1010
* @description
1111
*
1212
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
13-
*
13+
*
1414
* @example
15-
<doc:example>
15+
<doc:example module="customInterpolationApp">
1616
<doc:source>
1717
<script>
18-
var myApp = angular.module('App', [], function($interpolateProvider) {
18+
var customInterpolationApp = angular.module('customInterpolationApp', []);
19+
20+
customInterpolationApp.config(function($interpolateProvider) {
1921
$interpolateProvider.startSymbol('//');
2022
$interpolateProvider.endSymbol('//');
2123
});
22-
function Controller($scope) {
23-
$scope.label = "Interpolation Provider Sample";
24-
}
24+
25+
26+
customInterpolationApp.controller('DemoController', function DemoController() {
27+
this.label = "This bindings is brought you you by // interpolation symbols.";
28+
});
2529
</script>
26-
<div ng-app="App" ng-controller="Controller">
27-
//label//
30+
<div ng-app="App" ng-controller="DemoController as demo">
31+
//demo.label//
2832
</div>
2933
</doc:source>
34+
<doc:scenario>
35+
it('should interpolate binding with custom symbols', function() {
36+
expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.');
37+
});
38+
</doc:scenario>
3039
</doc:example>
3140
*/
3241
function $InterpolateProvider() {

0 commit comments

Comments
 (0)