mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-05-22 13:21:51 +00:00
docs($interpolate): add example for the provider
This commit is contained in:
parent
d59027c40e
commit
1a01e80b9c
1 changed files with 32 additions and 0 deletions
|
|
@ -8,6 +8,38 @@
|
||||||
* @description
|
* @description
|
||||||
*
|
*
|
||||||
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
* Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
|
||||||
|
*
|
||||||
|
* @example
|
||||||
|
<doc:example>
|
||||||
|
<doc:source>
|
||||||
|
<script>
|
||||||
|
var myApp = angular.module('App', [], function($interpolateProvider) {
|
||||||
|
$interpolateProvider.startSymbol('//');
|
||||||
|
$interpolateProvider.endSymbol('//');
|
||||||
|
});
|
||||||
|
function Controller($scope) {
|
||||||
|
$scope.label = "Interpolation Provider Sample";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<div ng-app="App" ng-controller="Controller">
|
||||||
|
//label//
|
||||||
|
</div>
|
||||||
|
</doc:source>
|
||||||
|
<doc:scenario>
|
||||||
|
describe('provider', function() {
|
||||||
|
beforeEach(module(function($interpolateProvider) {
|
||||||
|
$interpolateProvider.startSymbol('//');
|
||||||
|
$interpolateProvider.endSymbol('//');
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should not get confused with same markers', inject(function($interpolate) {
|
||||||
|
expect($interpolate('///').parts).toEqual(['///']);
|
||||||
|
expect($interpolate('////')()).toEqual('');
|
||||||
|
expect($interpolate('//1//')()).toEqual('1');
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
</doc:scenario>
|
||||||
|
</doc:example>
|
||||||
*/
|
*/
|
||||||
function $InterpolateProvider() {
|
function $InterpolateProvider() {
|
||||||
var startSymbol = '{{';
|
var startSymbol = '{{';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue