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

How to write ng2-toasty in Helper class? #77

Open
hhntpp opened this issue Apr 7, 2017 · 0 comments
Open

How to write ng2-toasty in Helper class? #77

hhntpp opened this issue Apr 7, 2017 · 0 comments

Comments

@hhntpp
Copy link

hhntpp commented Apr 7, 2017

  • I'm submitting a ...
    [x] bug report
    [x] feature request
    [ ] question about the decisions made in the repository

  • Do you want to request a feature or report a bug?
    bug and feature

  • What is the current behavior?
    I wanted to write a Helper class that has a function static addToast.
    But when it had been called, the toast didn't display. I pressed F12, the console didn't have error.
    If I write in component use it directly, it runs well.

  • If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar.
    static addToast(success: boolean, message: string) {
    var toastyService: ToastyService;
    var toastyConfig: ToastyConfig;

      // create the instance of ToastOptions
      var toastOptions: ToastOptions = {
          title: '',
          msg: message,
          showClose: true,
          timeout: 2000,
      };
      toastyConfig = new ToastyConfig();
      toastyConfig.theme = 'bootstrap';
      toastyConfig.position = 'center-center';
      toastyService = new ToastyService(toastyConfig);
      if (success)
          toastyService.success(toastOptions);
      else
          toastyService.error(toastOptions);
    

    }

  • What is the expected behavior?
    I want to intergrate ng2-toasty into a Helper class

  • Please tell us about your environment:

  • Angular version: 2.4.10
  • Browser: Chrome 57.0.2987.133 (64-bit)
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