-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.0] Allow grid to handle custom interpolation symbols #1576
Comments
Problem is with interpolate: config(function($interpolateProvider) {
$interpolateProvider.startSymbol('[[');
$interpolateProvider.endSymbol(']]');
}); how can i fix this in ng-grid? |
I would try fetching every grid template from templateCache and use a regex to swap out the interpolation symbols, then save them back to the cache. |
Does this work?
|
No there's no symbol options |
I'm changing this to a feature request. It looks like the There are some static in-code uses of |
Ok, thanks.. |
+1 for this (Using PHP Twig server-side here) I think the only clean solution is implementing using the $interpolate server. I'm gonna try regex-swapping the cache as temporary workaround. |
+1 to this feature ! |
+1 to this feature, I'm not able to use ng-grid without it. (Symony + Twig) |
Meanwhile, I modify a code that i was using with ng-grid 2.0 to do it compatible with ui-grid 3.0 /*
* Angular ng-grid interpolate template fix
* for working with non-default string interpolation symbols
*
*/
(function (ng) {
'use strict';
// Used for ng-grid to update interpolation symbols
ng.module("ui.grid").service(
"$InterpolateUpdateService",
['$templateCache', '$interpolate', function($templateCache, $interpolate){
this.changeGridInterpolate = function() {
var templates = [
'ui-grid/ui-grid-footer',
'ui-grid/ui-grid-group-panel',
'ui-grid/ui-grid-header',
'ui-grid/ui-grid-menu-button',
'ui-grid/ui-grid-no-header',
'ui-grid/ui-grid-row',
'ui-grid/ui-grid',
'ui-grid/uiGridCell',
'ui-grid/uiGridColumnFilter',
'ui-grid/uiGridColumnMenu',
'ui-grid/uiGridFooterCell',
'ui-grid/uiGridHeaderCell',
'ui-grid/uiGridMenu',
'ui-grid/uiGridMenuItem',
'ui-grid/uiGridRenderContainer',
'ui-grid/uiGridViewport'
];
var start = $interpolate.startSymbol();
var end = $interpolate.endSymbol();
for (var i = 0; i < templates.length; i++){
var template = templates[i];
var curTemplate = $templateCache.get(template);
if (start !== "}}"){
curTemplate = curTemplate.replace(/\{\{/g, start);
}
if (end !== "}}"){
curTemplate = curTemplate.replace(/\}\}/g, end);
}
$templateCache.put(template, curTemplate);
}
};
}]);
ng.module("ui.grid").run(["$InterpolateUpdateService", function($InterpolateUpdateService){
$InterpolateUpdateService.changeGridInterpolate();
}]);
})(angular); For further information, follow the link: http://brainoverflow.net/ui-grid-ng-grid-3-0-with-angularjs-interpolations-symbols-problem/ Cheers |
Added! Tutorial 313 will demonstrate this. |
AWESOME! :) |
superb! |
Hi,
i have this controller:
factory will get this data:
And this is result:
Why doesn't it show my data and heading for table?
The text was updated successfully, but these errors were encountered: