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

Cannot target which container to show toast in #226

Open
victorbadila opened this issue Feb 16, 2021 · 1 comment
Open

Cannot target which container to show toast in #226

victorbadila opened this issue Feb 16, 2021 · 1 comment

Comments

@victorbadila
Copy link

In the html I have the following containers:

<toaster-container [toasterconfig]="config1">
    </toaster-container>
    <toaster-container [toasterconfig]="config2">
</toaster-container>

and in the TS file:

  config1= new ToasterConfig({
    ...
    toastContainerId: 0,
  });

  config2 = new ToasterConfig({
    ...
    toastContainerId: 1,
  });

When I fire a toast I specify which id to target:

this.toasterService.pop({
      ...
      toastContainerId: 0,
    });

Yet the toast is displayed in both containers.

@victorbadila
Copy link
Author

victorbadila commented Feb 16, 2021

Update: it seems that by using non negative numbers as ids this actually works, if using 0 as an id it tends to publish everywhere. I got into this as I was actually using an enum and the first value was 0. This might be a bug.

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

1 participant