Zizzamia / ng-tasty

A tasty collection of reusable UI components for Angular, like grandma used to make. Like Table directive, WebSocket / Debounce / Throttle service, Range / Camelize / Slugify filters
MIT License
434 stars 64 forks source link

overriding templateHeadUrl and templateUrl in a custom theme is not working #202

Open vizog opened 8 years ago

vizog commented 8 years ago

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?

Zizzamia commented 8 years ago

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

sharok commented 8 years ago

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

tdharris commented 8 years ago

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.

stubbies commented 8 years ago

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

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

anikeevda commented 8 years ago

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.