notifyProvider?
vicary opened this issue · comments
I wanted to place an $httpProvider.interceptors
to globally prompt about erroneous requests, but it seems cgNotify
does not contain a provider for this.
@vicary let me know if this use case is not covered by my PR, if it is not, please post a code snippet showing how you would like to use it
Not sure why but your build does not show anything when calling notify('test')
.
Hmmm, when I run grunt serve
and go to http://localhost:9001/demo/ that all works for me
Just did some more testing, notify('string')
works for me
document.body
became null
right after the call stack of var defaultOptions = {...}
, so in line 90 templateElement
is appending to nothing. Not sure how it happens.
I suspect angular rebuilds document.body
in some way?
Modified line 184 and it works.
args.container = args.container || defaultOptions.container || angular.element('body');
Does it still fail if you change line 13 to container: angular.element('body')
?
Still fails because scripts can be in <head>
. You should put the initialization lines inside the factory initialization code, in your case notifyProvider()
, or maybe make another .config()
section for that very purpose.
Just pushed some changes. Thanks for helping me test this!
👍 lgtm, closing this.
💃
Adding protractor tests to ensure this "notify with a string does nothing" issue can't recur