Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
Ember.j - How to update chat when a message is created in database? (firebase as database)

I'm new to ember.js and firebase. At the moment I can post messages and see them displayed in a list like this:

//templates/show-messages.hbs

{{page-title "ShowMessages"}}

<div class="container">
    <div class="chat-container">
        {{#each this.model as |message|}}
        <div class="bubble">
            <h3>{{message.text}}</h3>
            <p>{{message.username}}</p>
        </div>
        {{/each}}
    </div>
    <ChatInput class="Input" @username="" @text=""></ChatInput>
</div>


//routes/show-messages.js

import Route from '@ember/routing/route';

export default class ShowMessagesRoute extends Route {
  model() {
    return this.store.findAll('chat-message');
  }
}

The problem is that when viewing chat in another browser, the chat window doesnt update when I post a message. Hence, the chat doesnt really update like it should.

How do I solve this? Thanks.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Are you using the official EmberFire add-on? Live reloading as data changes requires subscribing to the source. The add-on provides a way to do this easily. Otherwise you'll need to handle this in your application (and I'm not sure how to do that).

about 4 years ago · Juan Pablo Isaza Relatório

0

In my experience EmberFire is not actively maintained. I would suggest this add-on: Ember-Cli-Zuglet

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda