This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree 2 files changed +48
-2
lines changed
2 files changed +48
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ function $InterpolateProvider() {
89
89
* against.
90
90
*
91
91
*/
92
- return function ( text , mustHaveExpression ) {
92
+ function $interpolate ( text , mustHaveExpression ) {
93
93
var startIndex ,
94
94
endIndex ,
95
95
index = 0 ,
@@ -141,7 +141,43 @@ function $InterpolateProvider() {
141
141
fn . parts = parts ;
142
142
return fn ;
143
143
}
144
- } ;
144
+ }
145
+
146
+
147
+ /**
148
+ * @ngdoc method
149
+ * @name ng.$interpolate#startSymbol
150
+ * @methodOf ng.$interpolate
151
+ * @description
152
+ * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
153
+ *
154
+ * Use {@link ng.$interpolateProvider#startSymbol $interpolateProvider#startSymbol} to change
155
+ * the symbol.
156
+ *
157
+ * @returns {string } start symbol.
158
+ */
159
+ $interpolate . startSymbol = function ( ) {
160
+ return startSymbol ;
161
+ }
162
+
163
+
164
+ /**
165
+ * @ngdoc method
166
+ * @name ng.$interpolate#endSymbol
167
+ * @methodOf ng.$interpolate
168
+ * @description
169
+ * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
170
+ *
171
+ * Use {@link ng.$interpolateProvider#endSymbol $interpolateProvider#endSymbol} to change
172
+ * the symbol.
173
+ *
174
+ * @returns {string } start symbol.
175
+ */
176
+ $interpolate . endSymbol = function ( ) {
177
+ return endSymbol ;
178
+ }
179
+
180
+ return $interpolate ;
145
181
} ] ;
146
182
}
147
183
Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ describe('$interpolate', function() {
113
113
} ) ) ;
114
114
115
115
116
+ it ( 'should expose the startSymbol in run phase' , inject ( function ( $interpolate ) {
117
+ expect ( $interpolate . startSymbol ( ) ) . toBe ( '((' ) ;
118
+ } ) ) ;
119
+
120
+
116
121
it ( 'should not get confused by matching start and end symbols' , function ( ) {
117
122
module ( function ( $interpolateProvider ) {
118
123
$interpolateProvider . startSymbol ( '--' ) ;
@@ -139,5 +144,10 @@ describe('$interpolate', function() {
139
144
it ( 'should expose the endSymbol in config phase' , module ( function ( $interpolateProvider ) {
140
145
expect ( $interpolateProvider . endSymbol ( ) ) . toBe ( '))' ) ;
141
146
} ) ) ;
147
+
148
+
149
+ it ( 'should expose the endSymbol in run phase' , inject ( function ( $interpolate ) {
150
+ expect ( $interpolate . endSymbol ( ) ) . toBe ( '))' ) ;
151
+ } ) ) ;
142
152
} ) ;
143
153
} ) ;
You can’t perform that action at this time.
0 commit comments