@kosmonaFFFt wrote:
Hello all...
I want to access inner DOM nodes from component code before rendering. Example:
// Some template. {{#data-table items=model}} <thead> <tr> <th>ID</th> <th>Name</th> <th>Driver class</th> <th>Connection string</th> </tr> </thead> {{/data-table}} // data-table.hbs {{yield}} <tbody> {{#each items as |item|}} <tr> {{#each columns as |column|}} <td>Hello, datatable...</td> {{/each}} </tr> {{/each}} </tbody> // data-table.js export default Ember.Component.extend({ tagName: 'table', classNames: ['ui', 'table'], items: [], columns: [], // How to access inner thead > tr > th elements from some-template.hbs for columns property initialization? });
Is it possible?
Posts: 3
Participants: 2