mercredi 17 mai 2017

emberjs set is not a function

I am working with emberjs and having a little problem now.

I want to make a query filtering records from the server so i hardcoded an object the works fine with the filtering process, the problem that i am having now is that i want to handle a button click to change the values of the very same object to change the filtering options but i get the same error again and again "set is not a function"

here is my controller

  settings: {
    where: {
      done: false,
      date: {
       ">":new Date(new Date().setHours(0,0,0,0)).getTime(),
       "<":new Date(new Date().setHours(23,59,59,999)).getTime()
      }
   }
 }, 
 actions: {
   filterDone(){
     var x = this.get('settings')
     x.set('done', true)
     console.log(x);
   }
 }

and my template

<button  class="filter-button">Done</button>`

 
   <div class="ux-bill">
    
     <div class="ux-bill-item w-clearfix">
       <div class="ux-bill-item-price">
         <div class="ux-bill-item-price-number">
           .00</div>
            <div class="ux-bill-item-price-currncy">RS</div>
            
            <div class="push-right-beside-price">DONE</div>
            
        </div>
        <div class="ux-bill-item-person w-clearfix">
            <div class="ux-bill-item-person-icon">
            
            </div>
            <div class="ux-bill-item-person-name">
               </div>
            <div class="ux-bill-item-person-service">
             </div>
         </div>
        </div>
     
      </div>
    
  `

I have skipped some html cuz i don't think it's could be relevant in any shape,




Aucun commentaire:

Enregistrer un commentaire