2016-07-14 4 views
3

以下の構文のコントローラーで上記のモジュールを使用することができますが、サービスで同じものを使用しようとしている間は動作しません。コントローラではなく、anuglarサービスでangle-ui-notificationを使用しますか?

app.controller('regulationCtrl', function ($scope, $rootScope, $http, $window, $location,Notification) { 
      Notification.primary({message: "Some error message", templateUrl: "custom_template.html", scope: $scope}); 
//THIS CODE WORKS FINE 
}); 

app.service('fileUploadRegulations', function ($http,Notification, $rootScope) { 
    this.uploadFileToUrl = function (file, country, juridiction, uploadUrl,Notification) { 
    Notification.primary({message: "Some error msg:", templateUrl: "custom_template.html", scope: $scope}); 
//THIS CODE NOT WORKING 
} 
}); 

プラグイン公式URL:https://github.com/alexcrack/angular-ui-notification

答えて

0

あなたが表示されないはずUIサービスから通知。コールバックまたはイベントを使用して、「何か」(あなたの場合はファイルアップロードと思われる)が発生したことをコントロールに通知できます。 UIコントローラは通知ポップアップを表示します。

関連する問題