dimanche 26 février 2017

How to import handlebars template in controller and place it in another handlebars template

I am sorry if this question is silly. I have started working on front end with ember js and I am loving it. I am stuck at a point where I want to import a handlebars template in ember js controllers and attach it to div.

So How to import a handlebars template in controller and populate it and place it inside another handlebars template.

Here is my controller:

import Ember from 'ember';

export default Ember.Controller.extend({

    actions: {
    search: function() {
            alert("done");
          }
    }

});

here is the handlebars template:

<table class="table table-striped">
   <thead>
   <tr>
       <th>Name</th>
       <th>Mark</th>
       <th>Subject</th>
   </tr>
   </thead>
   <tbody>
   
   <tr>
       <td></td>
       <td></td>
       <td></td>
   </tr>
   
   </tbody>
 </table>

I have published the code on github and url is : http://ift.tt/2mrHFfG




Aucun commentaire:

Enregistrer un commentaire