Skip to content

Commit 297006b

Browse files
committed
Support function templates
ui-grid fails when template is defined as a function, for example: $templateCache.put('ui-grid/uiGridCell', function (elem, attrs) { return "<div class=\"ui-grid-cell-contents\" title=\"TOOLTIP\">{{COL_FIELD CUSTOM_FILTERS}}</div>" });
1 parent caf8ae5 commit 297006b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/core/services/gridClassFactory.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
templateGetPromises.push(gridUtil.getTemplate(col[providedType])
113113
.then(
114114
function (template) {
115+
if ( angular.isFunction(template) ) { template = template(); }
115116
var tooltipCall = ( tooltipType === 'cellTooltip' ) ? 'col.cellTooltip(row,col)' : 'col.headerTooltip(col)';
116117
if ( tooltipType && col[tooltipType] === false ){
117118
template = template.replace(uiGridConstants.TOOLTIP, '');
@@ -224,4 +225,4 @@
224225
return service;
225226
}]);
226227

227-
})();
228+
})();

0 commit comments

Comments
 (0)