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

maxcount is not working #101

Open
fidelove opened this issue Sep 29, 2016 · 6 comments
Open

maxcount is not working #101

fidelove opened this issue Sep 29, 2016 · 6 comments

Comments

@fidelove
Copy link

I have configured the param maxcount, but it seems not to be working.

Looking into the code seems like only the default value is used.

Thanks in advance

@zygmcc
Copy link

zygmcc commented Oct 3, 2016

do you change
this.options = {
delay: 2000,
startTop: 10,
startRight: 10,
verticalSpacing: 10,
horizontalSpacing: 10,
positionX: 'center',
positionY: 'top',
replaceMessage: false,
templateUrl: 'angular-ui-notification.html',
onClose: undefined,
closeOnClick: true,
maxCount: 2, // 0 - Infinite
container: 'body'
};
the param: "maxCount"?
My project works well with angularjs 1.4.6

@zygmcc
Copy link

zygmcc commented Oct 3, 2016

the param: "maxCount" default is 0, means infinite

@fidelove
Copy link
Author

fidelove commented Oct 6, 2016

Hello,

I have injected the parameters in the notification constructor:

 Notification.primary({
 templateUrl: 'partials/notification.html',
 scope: $notifScope,
 delay: notification.displayTime,
 positionY: notification.yPosition,
 positionX: notification.xPosition,
 maxCount: notification.maxCount, 
 onClose: function() {
      console.log('Close Notification');
 }

notification is an object received from the back, and it is correctly initialised with all the requested values.

May the problem come from transpilation from TypeScript to javascript?

As workaround I manually check the number of displayed notifications.

Thanks in advance and best regards.

@zygmcc
Copy link

zygmcc commented Oct 6, 2016

@fidelove
your "notification" object came from an Angular promise? If so , try to use synchronization way instead of asynchronous

@RodrigoPetter
Copy link

I was doing some tests and despite the documentation in this link that says

Options can be passed to configuration provider globally or used in the current message.

Some options only work in the configuration of the provider like :

.config(function(NotificationProvider)` {
        NotificationProvider.setOptions({
            delay: 10000,
            maxCount: 5
        });

A working example can be found here

But I realy would like to see it working as a message parameter, because in my case, depending on the situation, I need to show it with differents numbers. Exemplo: Top-Right stack in 15 itens and Bottom-Right stack in 3.

Some one can confirm if this is the expected behavior?
There is some way that I can achieve the discribed exemple?

@n-lavrenko
Copy link

n-lavrenko commented Aug 11, 2018

This is not working if I should change maxCount dynamically. I'm incredibly upset.
I will fork this repo for make a fix.
So, this code should work, but no:

abstract: true,
controllerAs: 'vm',
onEnter: function() {
     NotificationProvider.setOptions({
            maxCount: 99
     });
  },
onExit: function() {
   NotificationProvider.setOptions({
           maxCount: 3
    });
}

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

4 participants