You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add a postProcessTemplate() function to the gridUtil service that swaps
out interpolation symbols if they're different from the default ones.
* Change getTemplate() to use this function when returning templates
* Add tests to the gridUtil spec for getTemplate() with custom
interpolation symbols
Fixes#1576
Combining AngularJS with other frameworks/tools sometimes requires changing the normal interpolation symbols (`{{` and `}}`) to something else, like `[[` or `%`.
6
+
<br>
7
+
<br>
8
+
UI Grid will automatically detect the change and transform any default symbols in the templates it uses to the custom values. This means that in the unlikely event
9
+
you're expecting to use `{{` or `}}` to signify something in your custom-interpolation-symbol application, then inside the grid your stuff will likely break.
10
+
11
+
<example module="app">
12
+
<file name="app.js">
13
+
var app = angular.module('app', ['ngAnimate', 'ui.grid']);
14
+
15
+
app.config(function($interpolateProvider) {
16
+
$interpolateProvider.startSymbol('[[');
17
+
$interpolateProvider.endSymbol(']]');
18
+
});
19
+
20
+
app.controller('MainCtrl', ['$scope', '$http', '$interpolate', function ($scope, $http, $interpolate) {
21
+
$scope.foo = 'whoohoo!';
22
+
$scope.startSym = $interpolate.startSymbol();
23
+
$scope.endSym = $interpolate.endSymbol();
24
+
25
+
$scope.gridOptions = {
26
+
enableSorting: true,
27
+
columnDefs: [
28
+
{ field: 'name' },
29
+
{ field: 'gender' },
30
+
{ field: 'company', enableSorting: false }
31
+
]
32
+
};
33
+
34
+
$http.get('/data/100.json')
35
+
.success(function(data) {
36
+
$scope.gridOptions.data = data;
37
+
});
38
+
}]);
39
+
</file>
40
+
<file name="index.html">
41
+
<div ng-controller="MainCtrl">
42
+
This app uses [[ startSym ]] and [[ endSym ]] for interpolation symbols: [[ foo ]]
0 commit comments