title: How to control toastr options (or set them globally) from Angular controller or module
body: <p>Based upon a <a href="https://stackoverflow.com/questions/26309573/fire-notification-toaster-in-any-controller-angularjs">prior SO article</a> on injecting toastr into your app/controller. I have setup my app.js as follows:</p>
  
  <pre><code>(function () {
  
     app = angular.module("app", ['breeze.angular']).value('ngToastr', toastr);
  
      //added toaster as factory so it can be injected into any controller
     angular.module('app').factory('ngNotifier', function (ngToastr) {
         return {
             notify: function (msg) {
                 ngToastr.success(msg);
             },
             notifyError: function (msg) {
                 ngToastr.error(msg);
             },
             notifyInfo: function (msg) {
                 ngToastr.info(msg);
             }
         }
     });
  
  })();
  </code></pre>
  
  <p>as one of the answers stated I now have access to the toastr control from any controller. </p>
  
  <pre><code>app.controller('reportController', function ($scope, reportLibraryService, ngNotifier,  $log) {
      //report section
  
  
      var rvm = this;
      rvm.getReportList = GetReportList;
      rvm.onError = OnError;
      rvm.onReportComplete = OnReportComplete;
  
      $scope.userId = 1;
      GetReportList($scope.userId);
  
      function OnReportComplete(response) {
          $scope.reportList = response;
          ngNotifier.notify("Reports Loaded");
  
      };
  
      function OnError(reason) {
          $scope.error = "Could not fetch the data.";
          $log.error(reason);
      };
  
      function GetReportList(userId) {
          $log.info("Getting reports for userid " + userId)
          reportLibraryService.getAllReports($scope.userId).then(rvm.onReportComplete, rvm.onError);
      };
  });
  </code></pre>
  
  <p>The question I have is how do I override the default options? I have tried two approaches so far. First adding an toastr div within the html with the options set, which did not work. And then I tried adding them within the factory but they were ignored there as well.</p>
  
  <pre><code>   angular.module('app').factory('ngNotifier', function (ngToastr) {
         return {
             notify: function (msg) {
                 ngToastr.success(msg);
                 ngToastr.options = {
                     "closeButton": false,
                     "debug": false,
                     "progressBar": false,
                     "positionClass": "toast-bottom-right",
                     "onclick": null,
                     "showDuration": "300",
                     "hideDuration": "1000",
                     "timeOut": "5000",
                     "extendedTimeOut": "1000",
                     "showEasing": "swing",
                     "hideEasing": "linear",
                     "showMethod": "fadeIn",
                     "hideMethod": "fadeOut"
                 }
             }, ...
  </code></pre>
  
  <p>As a second part to this is toastr the correct tool to use or should I be using angular-toaster instead since this is an angular app? I currently do not have any jQuery dependencies anywhere else in my application.</p>
  
  <p>thanks for any suggestions</p>