mercredi 18 novembre 2020

Not able to bind data in posts.hbs

templates/posts.hbs

<h2>Posts</h2>
    
      <div>
        <h3></h3>
        <h3></h3>
        <h3></h3>
        <h4></h4>
      </div>
    
    

serializers/posts.js

import DS from 'ember-data';

export default DS.JSONAPISerializer.extend({
  normalizeResponse(store, primaryModelClass, payload, id, requestType){
    console.log(payload); //in console getting data here properly
    return this._super(store, primaryModelClass, payload, id, requestType);
  }
});

routes/posts.js

import Ember from 'ember';

export default Ember.Route.extend({
  model(){
    return this.store.findAll('post');
  }
});

Getting data from backend API point and printing data in console properly. Everything fine. But not binding in handlebars (posts.hbs). Can someone help me with this? New to ember Js.




Aucun commentaire:

Enregistrer un commentaire