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

Commit 560951e

Browse files
jbedardlgalfaso
authored andcommitted
refactor($interpolate): move standalone functions to the service scope
Closes #10413
1 parent 1735d5e commit 560951e

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

src/ng/interpolate.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,28 @@ function $InterpolateProvider() {
8888
return '\\\\\\' + ch;
8989
}
9090

91+
function unescapeText(text) {
92+
return text.replace(escapedStartRegexp, startSymbol).
93+
replace(escapedEndRegexp, endSymbol);
94+
}
95+
96+
function stringify(value) {
97+
if (value == null) { // null || undefined
98+
return '';
99+
}
100+
switch (typeof value) {
101+
case 'string':
102+
break;
103+
case 'number':
104+
value = '' + value;
105+
break;
106+
default:
107+
value = toJson(value);
108+
}
109+
110+
return value;
111+
}
112+
91113
/**
92114
* @ngdoc service
93115
* @name $interpolate
@@ -243,23 +265,6 @@ function $InterpolateProvider() {
243265
$sce.valueOf(value);
244266
};
245267

246-
var stringify = function(value) {
247-
if (value == null) { // null || undefined
248-
return '';
249-
}
250-
switch (typeof value) {
251-
case 'string':
252-
break;
253-
case 'number':
254-
value = '' + value;
255-
break;
256-
default:
257-
value = toJson(value);
258-
}
259-
260-
return value;
261-
};
262-
263268
return extend(function interpolationFn(context) {
264269
var i = 0;
265270
var ii = expressions.length;
@@ -294,11 +299,6 @@ function $InterpolateProvider() {
294299
});
295300
}
296301

297-
function unescapeText(text) {
298-
return text.replace(escapedStartRegexp, startSymbol).
299-
replace(escapedEndRegexp, endSymbol);
300-
}
301-
302302
function parseStringifyInterceptor(value) {
303303
try {
304304
value = getValue(value);

0 commit comments

Comments
 (0)