angular-pnotify icon indicating copy to clipboard operation
angular-pnotify copied to clipboard

fails to set defaults

Open mickro opened this issue 8 years ago • 0 comments

Using "angular-pnotify": "~0.1.2"

'use strict';

angular.module('MyApp')
  .config(['notificationServiceProvider', function(notificationServiceProvider) {
    notificationServiceProvider.setDefaults({
      styling: "bootstrap3",
      history: false
    });
  }])
  .factory('notification', ['notificationService', function (notificationService) {

    return {
      error: function(title, text, options) {
        var hash = { type: 'error', delay: 4000000 };
        if (text === null || text === undefined) {
          text = "";
        }

        angular.extend(hash, {title: title, text: text}, options);
        notificationService.notify(hash);
      },
      success: function(title, text, options) {
        console.log( PNotify.prototype.options ); /// <<< check defautls >>>>
        var hash = { type: 'success', delay: 2000 };

        if (text === null || text === undefined) {
          text = "";
        }

        angular.extend(hash, {title: title, text: text}, options);
        notificationService.notify(hash);
      }
    };
  }]);

Here is my notificationService. Where I set my default, particularly the styling to bootstrap3.

Then I see no styling in notifications. So I logged PNotify.prototype.options. And obtains this object:

Object {title: false, title_escape: false, text: false, text_escape: false, styling: "brighttheme"…}

Also this exact code used to work with "angular-pnotify": "~0.0.6".

Is that a bug?

mickro avatar Feb 06 '17 11:02 mickro