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

Html button event #37

Closed
danielemontesi opened this issue Apr 20, 2016 · 1 comment
Closed

Html button event #37

danielemontesi opened this issue Apr 20, 2016 · 1 comment

Comments

@danielemontesi
Copy link

danielemontesi commented Apr 20, 2016

How can i insert html button and add ng-click event? I do thath

ngNotify.set('<button class="btn btn-sm btn-default" ng-click="test();"><i class="fa fa-times"</i>No</button>', { type: 'info', sticky: true, button: true });

but does not work

@matowens
Copy link
Owner

You're not able to pass through a template and scope as the message. It's expecting a string that it can just append to an element to display to the user.

If you're looking to trigger a function call after the user closes the message, you should be able to pass in your function as a callback in the set() method like this:

var callback = function() { alert('show this when the user closes the message'); };

ngNotify.set('Message to user', { type: 'info', sticky: true, button: true }, callback);

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