based on http://cgross.github.io/angular-notify