mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-09 15:24:43 +00:00
docs($interpolate): fix example for provider w/ custom symbols
This commit is contained in:
parent
5e45fd4ac6
commit
680b8174ac
1 changed files with 17 additions and 8 deletions
|
|
@ -10,23 +10,32 @@ var $interpolateMinErr = minErr('$interpolate');
|
||||||
* @description
|
* @description
|
||||||
*
|
*
|
||||||
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
||||||
*
|
*
|
||||||
* @example
|
* @example
|
||||||
<doc:example>
|
<doc:example module="customInterpolationApp">
|
||||||
<doc:source>
|
<doc:source>
|
||||||
<script>
|
<script>
|
||||||
var myApp = angular.module('App', [], function($interpolateProvider) {
|
var customInterpolationApp = angular.module('customInterpolationApp', []);
|
||||||
|
|
||||||
|
customInterpolationApp.config(function($interpolateProvider) {
|
||||||
$interpolateProvider.startSymbol('//');
|
$interpolateProvider.startSymbol('//');
|
||||||
$interpolateProvider.endSymbol('//');
|
$interpolateProvider.endSymbol('//');
|
||||||
});
|
});
|
||||||
function Controller($scope) {
|
|
||||||
$scope.label = "Interpolation Provider Sample";
|
|
||||||
}
|
customInterpolationApp.controller('DemoController', function DemoController() {
|
||||||
|
this.label = "This bindings is brought you you by // interpolation symbols.";
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<div ng-app="App" ng-controller="Controller">
|
<div ng-app="App" ng-controller="DemoController as demo">
|
||||||
//label//
|
//demo.label//
|
||||||
</div>
|
</div>
|
||||||
</doc:source>
|
</doc:source>
|
||||||
|
<doc:scenario>
|
||||||
|
it('should interpolate binding with custom symbols', function() {
|
||||||
|
expect(binding('demo.label')).toBe('This bindings is brought you you by // interpolation symbols.');
|
||||||
|
});
|
||||||
|
</doc:scenario>
|
||||||
</doc:example>
|
</doc:example>
|
||||||
*/
|
*/
|
||||||
function $InterpolateProvider() {
|
function $InterpolateProvider() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue