jirikavi/AngularJS-Toaster — pull request #57 by fracz (2014-10-23 21:17:17+00:00)
Title: Allow toaster.clickHandler to be a callback function

This PR allows to specify clickHandler as a anonymous funciton. Old functionality is left but it does not require to assign method to a scope anymore.

Before (still works):

```
toaster.pop('success', "title", 'Its address is https://google.com.', 15000, 'trustedHtml', 'goToLink');
$scope.goToLink = function(toaster) {
var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
if (match) $window.open(match[0]);
return true;
};
```

After:

```
toaster.pop('success', "title", 'Its address is https://google.com.', 15000, 'trustedHtml', function(toaster) {
var match = toaster.body.match(/http[s]?:\/\/[^\s]+/);
if (match) $window.open(match[0]);
return true;
});
```