angular ui-grid 添加 img link 到列 headers

angular ui-grid add img link to column headers

我需要将 img link 注入某些列 header。所有这些 header 都有下拉过滤。通过这个网站向底部:https://github.com/angular-ui/ui-grid/wiki/Templating

当我将它用于 1 列的单元格模板进行测试并单击 header 名称时,出现错误:

TypeError: v2.sort is not a function
    at fn (eval at compile (angular.js:15156), <anonymous>:4:241)
    at e (angular.js:26744)
    at m.$eval (angular.js:17972)
    at m.$apply (angular.js:18072)
    at HTMLDivElement.<anonymous> (angular.js:26749)
    at cg (angular.js:3613)
    at HTMLDivElement.d (angular.js:3601)

即使在出现错误之前,该列也没有用于排序的下拉箭头,也没有下拉过滤器。我怎么得到它?好像这不是默认模板?

糟糕,好像是错误的模板。我在这里使用了它,它起作用了:

https://github.com/angular-ui/ui-grid/blob/master/src/templates/ui-grid/uiGridHeaderCell.html

有趣的是,如果我将其移动到它自己的 html 文件中,它会说:

fetching url Views/CustomHeaderCellTemplate.html

但是 header 是空白的,就像它不起作用一样。不知道为什么会这样。