ng-tasty icon indicating copy to clipboard operation
ng-tasty copied to clipboard

overriding templateHeadUrl and templateUrl in a custom theme is not working

Open vizog opened this issue 9 years ago • 5 comments

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?

vizog avatar Jan 06 '16 13:01 vizog

Is it possible that path you are passing is wrong, try without /

Zizzamia avatar Jan 07 '16 01:01 Zizzamia

Confirm, no erros, all renders fine, but I don't see my changes in template. It looks like it takes from default

sharok avatar Jan 16 '16 07:01 sharok

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.

tdharris avatar Jan 27 '16 21:01 tdharris

I have the same problem, it only works when you add it as attr.

<div tasty-pagination template-url="/tpl/table/pagination.html"></div>

stubbies avatar Mar 13 '16 13:03 stubbies

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.

anikeevda avatar Jun 05 '16 16:06 anikeevda