lundi 28 août 2017

How to interpret with each loop?

I am trying to interpret with each loop. but I am not able to come with a good solucation ( ember way! )

how to handle this scernario?

From the loop I am printing 16 digit. whenever the index reach 4 ( index % 4 == 0 ) I would like to add a hyphen.(-)

how to achive this?

here is my route.js :

import Ember from 'ember';

export default Ember.Route.extend({
  model(){
    return [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
  }
});

my hbs file:

<h1>Each with condition </h1>

    
 

but I look like:

<h1>Each with condition </h1>

      --  
 

So, what is the correct ember approach for this?

Twiddle here




Aucun commentaire:

Enregistrer un commentaire