vendredi 10 mars 2017

Add data to the application.hbs template in Ember.js

I'm trying to do something which should be simple but I'm note sure it's even possible...

I want to add data into the default template application.hbs of Ember.js for exemple have the current date in my footer.

Should I do it with a component ? I tried to pass data throught the index.js route but nothing show up :s

My index.js:

import Ember from 'ember';

export default Ember.Route.extend({
  model: function () {
    const data = [
      {rate: 1.23},
      {rate: 1.23},
      {rate: 1.23}
    ];
    return data;
  }
});

My application.hbs:

<div class="container">
  <div class="row">
    <div class="col-md-12">
      
      
        <p></p>
      
    </div>
  </div>
</div>




Aucun commentaire:

Enregistrer un commentaire