How to use the angular2-toaster.ToasterService function in angular2-toaster

To help you get started, we’ve selected a few angular2-toaster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dotnetcore / OSharp / tests / web / OSharp.Demo.Web.NG / src / app / shared / osharp.ts View on Github external
static msg(msg, type) {
            type = type || 'info';
            var config = {
                timeOut: type == "error" ? 6000 : 3000,
                positionClass: "toast-top-center",
                closeButton: true,
                newestOnTop: false,
                type: type
            };
            var toastr = new ToasterService();
            toastr.pop(config);

            // toastr.options = {
            //     timeOut: type == 'error' ? '6000' : '3000',
            //     positionClass: "toast-top-center",
            //     closeButton: true,
            //     newestOnTop: false
            // }
            //toastr[type](msg, "")
        }
    }