Search code examples
angularjsconfirm

angular confirm, confirmIf tweaking


I use angular and angular-confirm

I made an interface with a list of buttons. http://awesomescreenshot.com/0465v52t3e

On each button there is a confirm like this :

<button ng-click="..." class="btn btn-lg btn-invisible" type="button"
        confirm="{{'Realy want to add it ?'|translate}}" >
    <span aria-hidden="false" class="glyphicon glyphicon-unchecked"></span>
</button>

There is a lot of buttons in the list so if the user needs to click for example 10 of them, the confirm message will be boring after 2/3 times.

QUESTION :

Is there a way to display inside the confirm modal a button for "ok i understand, stop showing confirm" and on other button click confirm will not show.

It is on same idea that how modern web browser handle popup .

thanks


Solution

  • You can override $confirmModalDefaults (to change confirm template and controller) and use confirm-if.

    Or you can write your own confirm - https://github.com/Schlogen/angular-confirm/blob/master/angular-confirm.js is just ~100 rows.