2016-05-16 17 views
0

在這種情況下(smsAll)函數完成運行後,如何放置彈出消息,例如「message sent successfully」?函數完成後放置彈出消息

控制器
$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> 
+0

使用任何通知庫,恩。 https://notifyjs.com/ – Bettimms

回答

0

爲什麼不使用一些角度通知moduel? 就像this 源代碼here

,或者安裝與鮑爾

bower install angular-notify --save 

添加DIST /角notify.js和DIST /角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'}); 

}