Skip to content

fails to set defaults #17

@mickro

Description

@mickro

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions