Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flashMessages is not working in newly create ember app #385

Open
Randhir-93 opened this issue Jul 14, 2022 · 1 comment
Open

flashMessages is not working in newly create ember app #385

Randhir-93 opened this issue Jul 14, 2022 · 1 comment

Comments

@Randhir-93
Copy link

Randhir-93 commented Jul 14, 2022

  1. Create a new app using ember new testApp
  2. Installed latest version of ember-cli-flash
  3. created a test component
    `import Component from "@glimmer/component";
    import { inject as service } from "@ember/service";

export default class TestComponent extends Component {
@service flashMessages;

constructor() {
    super(...arguments);
    setTimeout(() => {
        this.flashMessages.alert("dsfsf");
    }, 1000)
}

}`
Calling TestComponent from application.hbs but flash message is not showing.

@Randhir-93 Randhir-93 changed the title flashMessages is not working in cloned super-rentals repo from github flashMessages is not working in newly create ember app Jul 14, 2022
@charlesfries
Copy link
Contributor

Make sure you are also displaying the message queue somewhere in the template:

{{#each this.flashMessages.queue as |flash|}}
  <FlashMessage @flash={{flash}} />
{{/each}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants