0

Dear experts: I am using toastr.success and toastr.warning and they are working fine. BUT it is not working with toastr.confirm. I have added the jquery,angularjs and toastr libraries . Any idea or help Thanks in advance.

<tbody>
                                <tr ng-repeat="a in all | filter : table" ng-click="showInEdit(a)" ng-class="{selected1:a === selectedRow}" style="cursor:pointer;">

                                    <td>{{a.SpecName}}</td>
                                    <td>{{a.DegName}}</td>
                                    <td>{{a.DocName}}</td>
                                    <td>{{a.Service_Type}}</td>
                                    <td>{{a.Service_Group}}</td>
                                    <td>{{a.Sub_service}}</td>
                                    <td style="text-align: center; width: 50px">
                                        <a href="">
                                            <img ng-click="edit();$event.stopPropagation();$event.preventDefault();" src="assets/images/pencil.png" />
                                        </a>
                                        <a href="">
                                            <img ng-click="delete(a)" src="assets/images/cross.png" />
                                        </a>
                                    </td>
                                </tr>
                            </tbody>

in controller

$scope.delete = function (sys) {
    toastr.confirm('Are you sure?', {onOk: (Doctorssetup.delete(sys.Sys_Key))  , onCancel: ({}) });}

error is TypeError: toastr.confirm is not a function at ChildScope.$scope.delete (AnglController.js:288)

hassanzi
  • 191
  • 17
  • What that's telling you is that there is no "confirm" type for toast. You can see for yourself if you look at the [source code](https://github.com/CodeSeven/toastr/blob/master/toastr.js) – Matt M Feb 07 '18 at 13:42
  • actually i found it in this link https://stackoverflow.com/questions/37701722/how-to-show-a-confirmation-dialog-box-in-toastr/40661804 and tried to apply it on my project, but i found that error – hassanzi Feb 07 '18 at 13:48
  • The example in that answer is using a different port of the toastr library, specifically for React/Redux. It has a confirm method. The angular version you are using does not. You could look at [this answer](https://stackoverflow.com/a/37701921/316738) from the same question. – Matt M Feb 07 '18 at 14:07
  • Thank you very much, I will try to use it and if i got error i will tell you, Thanks – hassanzi Feb 07 '18 at 14:30

0 Answers0