JanStevens / angular-growl-2

growl-like notifications for angularJS projects
MIT License
285 stars 97 forks source link

addServerMessages doesn't use global config #33

Open genuinefafa opened 10 years ago

genuinefafa commented 10 years ago

I found out that addServerMessages function (the one used by serverMessagesInterceptor) overrides global config parameters check this lines.

It might be possible to use angular.extend in order to retain the current global setup? Or maybe just take server parameters over default ones.

I prefer extend angular-growl-2 features over making my own logic.

What do you think?

JanStevens commented 10 years ago

What config gets overwritten?

A quick look shows me that the severity, message and title gets extracted using the global defined keywords and then send to the sendMessage function which uses the global config to send the messages.

genuinefafa commented 10 years ago

The ttl property. And, what about if I chose to have a common title for everything? same thing. I just need to have a ttl set for every message, including the ones from the server.

JanStevens commented 10 years ago

Normally the server messages follow the global config. Only the variables, title, severity and message are extracted.

Do you want to differentiate your config between server sent messages and normal growl messages? I don't think its a good idea to include the ttl in the server response, thats clearly a client side config.

genuinefafa commented 10 years ago

Maybe I'm mistaken, but the global TTL config is overridden in the interceptor.

I do want to differentiate the TTL. Yes.