ng-table
ng-table copied to clipboard
Won't work with custom interpolation
Because templates are already cached with {{ }}, setting up custom interpolation in my app will produce incorrect output (e.g. a placholder saying {{getFilterPlaceholderValue...)
The following should fix it (based on similar issue):
angular.module("ngTable").service(
"$InterpolateUpdateService", function($templateCache, $interpolate){
'use strict';
this.changeGridInterpolate = function() {
var templates = [
'ng-table/filterRow.html',
'ng-table/filters/number.html',
'ng-table/filters/select-multiple.html',
'ng-table/filters/select.html',
'ng-table/filters/text.html',
'ng-table/groupRow.html',
'ng-table/header.html',
'ng-table/pager.html',
'ng-table/sorterRow.html'
];
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);
}
};
});
angular.module('ngTable').run(function($InterpolateUpdateService) {
'use strict';
$InterpolateUpdateService.changeGridInterpolate();
});
Does this mean that now we can render html inside cells?
Do you mean if (start !== "{{"){ ?
Are there any news for this bug/improvement?
This is the issue I think: https://github.com/esvit/ng-table/issues/1021