Search code examples
angularjsnode.jsstrongloop

Placing a pop out message once function has finished


How can I place a pop out message like 'message sent successfully' once the function has finished running in this case (smsAll)?

controller

    $scope.smsAll = function() {

        $scope.smsStatusZeroF2F = "";
        $scope.smsStatusMoreThanTenF2F = "";
        $scope.smsStatusBetween14F2F = "";

        if ($scope.isSMSzeroF2F) {
            $scope.smsZeroF2F();
        }

        if ($scope.isSMSmoreThanTenF2F) {
            $scope.smsMoreThanTenF2F();
        }

        if ($scope.isSMSBet14F2F) {
            $scope.smsBetween14F2F();
        }

        if ($scope.isSMSZeroPSL) {
            $scope.smsZeroPSL();
        }

        if ($scope.isSMStransAndsaas) {
            $scope.smsZeroTransOrSaasReport();
        }

    };

report.html

   <button type="button" class="btn btn-primary" ng-click="smsAll()">Send SMS for selected</button>

Solution

  • Why not used some angular notify moduel? Just like this Source code is here

    Or Install with Bower

    bower install angular-notify --save 
    

    Add dist/angular-notify.js and dist/angular-notify.css to your index.html.

    Add cgNotify as a module dependency for your module.

    angular.module('your_app', ['cgNotify']);
    

    usage:

    function myController($scope,notify){  // <-- Inject notify
    
      notify('Your notification message'); // <-- Call notify with your message
    
      notify({ message:'My message', templateUrl:'my_template.html'} );
    
    }