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

Commit f2e4257

Browse files
committed
refactor($interpolate): move standalone functions to the service scope
1 parent 497d25e commit f2e4257

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

src/ng/interpolate.js

+19-19
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,25 @@ 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+
case 'number':
103+
case 'boolean':
104+
return value;
105+
default:
106+
return toJson(value);
107+
}
108+
}
109+
91110
/**
92111
* @ngdoc service
93112
* @name $interpolate
@@ -243,20 +262,6 @@ function $InterpolateProvider() {
243262
$sce.valueOf(value);
244263
};
245264

246-
var stringify = function(value) {
247-
if (value == null) { // null || undefined
248-
return '';
249-
}
250-
switch (typeof value) {
251-
case 'string':
252-
case 'number':
253-
case 'boolean':
254-
return value;
255-
default:
256-
return toJson(value);
257-
}
258-
};
259-
260265
return extend(function interpolationFn(context) {
261266
var i = 0;
262267
var ii = expressions.length;
@@ -291,11 +296,6 @@ function $InterpolateProvider() {
291296
});
292297
}
293298

294-
function unescapeText(text) {
295-
return text.replace(escapedStartRegexp, startSymbol).
296-
replace(escapedEndRegexp, endSymbol);
297-
}
298-
299299
function parseStringifyInterceptor(value) {
300300
try {
301301
value = getValue(value);

0 commit comments

Comments
 (0)