ng-tasty
ng-tasty copied to clipboard
overriding templateHeadUrl and templateUrl in a custom theme is not working
I'm overriding templateUrl and templateHeadUrl in my custom theme. but the table is not picking the specified templates.
app.coffee:
$rootScope.myTheme =
init:count: 50
iconUp: 'sorting_asc'
iconDown: 'sorting_desc'
itemsPerPage: 50
templateHeadUrl:'/assets/partials/table/header.html'
templateUrl:'/assets/partials/table/pagination.html'
loadOnInit: true
and the html:
<div tasty-table bind-resource-callback="loadAssets" bind-theme="myTheme"
bind-init="initTable" bind-filters="filters" >
<table>
<thead tasty-thead not-sort-by="['info']" class="no-border"></thead>
<tbody>
<tr data-ng-repeat="row in rows">
<td>...</td>
</tr>
</tbody>
</table>
<div tasty-pagination></div>
</div>
other parts like itemsPerPage are working correctly but header and pagination is not loaded from my templates. Am I missing anything?
Is it possible that path you are passing is wrong, try without /
Confirm, no erros, all renders fine, but I don't see my changes in template. It looks like it takes from default
I am also seeing this. The default template is loaded regardless. I am needing to change the template because I've decided to start using bootstrap 4, and there are some small breaking changes that I can work-around with custom themes. This doesn't appear to be functioning, which is unfortunate.
I have the same problem, it only works when you add it as attr
.
<div tasty-pagination template-url="/tpl/table/pagination.html"></div>
As far as I can find that happens because each directive (tasty-thead, tasty-table, tasty-pagination) has personal theme.
My lazy solution was using an ng-template in script and then bind it through bind-template-url.