lundi 16 mars 2020

Changes in Ember data does not show the live changes in HTML

In my ember application as shown below when user clicks send the action in component will send the api post request and receive the successful data, can be see in ember inspector data tab, But I need to refresh the page to see newly added item, I tried some example shown in ember guide, nothing helps

My action code is

actions:{
    send(Text_Message){
        if(Text_Message != null){
            console.log(this.chatid);
            var data = {
                    "Message" : Text_Message,
                    "ChatId" : this.chatid
            }
            var store = this.get('store').createRecord('message',data)
            store.save().then((response)=>{
            })
        }else{
            alert("Type something to send")
        }
    }

}

handle bar template is


        <div>
        
            <div class= > 
                
             </div>
           
        </div>
        
        <div class = "groupmessage-no-Msg">
            <div class="groupmessage-msg-content"> No Messages </div>     
        </div>
        
        <div class = "groupmessage-msg-control">
            
            <div  class="groupmessage-sendbutton groupmessage-sendbutton1" >Send</div>
        </div>



Aucun commentaire:

Enregistrer un commentaire