功能完成后放置弹出消息

Placing a pop out message once function has finished

在这种情况下 运行 函数完成后,如何放置像 'message sent successfully' 这样的弹出消息 (smsAll)?

控制器

    $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>

为什么不使用一些 angular 通知模块? 就像this 源代码是here

或使用 Bower 安装

bower install angular-notify --save 

将 dist/angular-notify.js 和 dist/angular-notify.css 添加到您的 index.html.

将 cgNotify 添加为您的模块的模块依赖项。

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

用法:

function myController($scope,notify){  // <-- Inject notify

  notify('Your notification message'); // <-- Call notify with your message

  notify({ message:'My message', templateUrl:'my_template.html'} );

}