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

Server Side Notifications with referenceID? #122

Open
razblack opened this issue Nov 7, 2016 · 1 comment
Open

Server Side Notifications with referenceID? #122

razblack opened this issue Nov 7, 2016 · 1 comment

Comments

@razblack
Copy link

razblack commented Nov 7, 2016

Hello,

I have been using growl 2 and it is wonderful; however, I have a case where it would be nice to be able to control the referenceId from server side notifications.

In order for me to do this, I had to modify growl 2 (angular-growl.js line#275) and add a simple assignment such as:

config.referenceId = message['referenceId'];

It's a bit hacky, but seems to work.

In ASP.NET MVC, my model looks such as:

public class GrowlMessages
{
    public List<GrowlMessage> growlmessages;
    public GrowlMessages()
    {
        growlmessages = new List<GrowlMessage>();
    }
}

public class GrowlMessage
{
    public string growltext { get; set; }
    public string growlseverity { get; set; }
    public string growltitle { get; set; }
    public int referenceId { get; set; }

    public GrowlMessage()
    {
        referenceId = 0;
    }
}

and my app.js sets it up as:

    growlProvider.messagesKey("growlmessages");
    growlProvider.messageTextKey("growltext");
    growlProvider.messageSeverityKey("growlseverity");
    growlProvider.messageTitleKey("growltitle");

Would be great to be able to define a growlProvider.messageId in the app to integrate better with your schema.

maybe this is a feature request? :D

@flaviocysne
Copy link

This is already implemented.
I think the code you are looking for is:

growlProvider.messageReferenceIdKey("growlReferenceId");

The default value for the messageReferenceIdKey id referenceId.

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