samedi 18 août 2018

Ember js filtering the the data from the model

I am trying to filter the data from the ember model but I am unable to find the solution.

<h2>
//The file is in app/routes/notes.js<br/>
import Route from '@ember/routing/route';
<br/>
export default Route.extend({<br/>
 model()  {<br/>
 let l= this.store.findAll('note');<br/>
 return l;<br/>
 }<br/>
 });<br/>
 </h2>

------------------------------------------


<h2>
 //The file is app/templates/note.hbs <br/><br/>
 <br/>
 Title: <br/>
 Description: <br/>
 Date:<br/>
 
  <br/>
  </h2>

I am trying to filter the data return from a model but it is not working as I am thought.The JSON format used in this is

{title:title,description:description,date:date,status:status}

,I want to filter the output based upon the status and display on the template.But I am unable to modify the data it showing some errors. I Have tried filtered from the model itself or by controllers actions but not worked. Can anyone suggest the solution?


Aucun commentaire:

Enregistrer un commentaire