New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration level settings #10

Closed
rastographics opened this Issue Nov 22, 2014 · 5 comments

Comments

Projects
None yet
4 participants
@rastographics

rastographics commented Nov 22, 2014

Angular noob question, but I can't find this anywhere...
I studied the page referred to on your site for setting the global configuration of ngToast. With this code:

angular.module('myModule').config(function(ngToast){
 ngToast.settings.horizontalPosition = 'center';
});

angular give me error "Unknown provider: ngToast"
(If i remove this configuration block, ngToast otherwise works great with my setup.)

I'm sure the problem is me, but could you tell me if there is anything glaringly wrong with my code?
Maybe a few samples lines of how to do the configuration would be very helpful on the site, too.

Thanks

@tameraydin

This comment has been minimized.

Show comment
Hide comment
@tameraydin

tameraydin Nov 22, 2014

Owner

Your code is almost there, providers are available with the -Provider suffix:

angular
  .module('myModule')
  .config(['ngToastProvider', function(ngToast) {
    ngToast.configure({
      verticalPosition: 'bottom',
      horizontalPosition: 'center',
      maxNumber: 3
    });
  }]);

Hope this helps, and sorry for lack of documentation about this usage.

Owner

tameraydin commented Nov 22, 2014

Your code is almost there, providers are available with the -Provider suffix:

angular
  .module('myModule')
  .config(['ngToastProvider', function(ngToast) {
    ngToast.configure({
      verticalPosition: 'bottom',
      horizontalPosition: 'center',
      maxNumber: 3
    });
  }]);

Hope this helps, and sorry for lack of documentation about this usage.

@rastographics

This comment has been minimized.

Show comment
Hide comment
@rastographics

rastographics Nov 22, 2014

Thanks, works perfect.

rastographics commented Nov 22, 2014

Thanks, works perfect.

@fervanrijswijk

This comment has been minimized.

Show comment
Hide comment
@fervanrijswijk

fervanrijswijk Dec 4, 2015

Hmmm, not working here. Using the exact same code gives me this error:

Error: [$injector:unpr] Unknown provider: ngToastProvider

fervanrijswijk commented Dec 4, 2015

Hmmm, not working here. Using the exact same code gives me this error:

Error: [$injector:unpr] Unknown provider: ngToastProvider

@matt-jay

This comment has been minimized.

Show comment
Hide comment
@matt-jay

matt-jay May 12, 2016

I have the same issue as @fervanrijswijk.

In my Angular-Meteor app, I am trying

angular.module(...).
.config(config);

function config(..., $ngToastProvider) {
    'ngInject';

    $ngToastProvider.configure({
      verticalPosition: 'bottom',
      horizontalPosition: 'center',
      maxNumber: 3
    });
}

matt-jay commented May 12, 2016

I have the same issue as @fervanrijswijk.

In my Angular-Meteor app, I am trying

angular.module(...).
.config(config);

function config(..., $ngToastProvider) {
    'ngInject';

    $ngToastProvider.configure({
      verticalPosition: 'bottom',
      horizontalPosition: 'center',
      maxNumber: 3
    });
}
@tameraydin

This comment has been minimized.

Show comment
Hide comment
@tameraydin

tameraydin May 12, 2016

Owner

$ngToastProvider -> ngToastProvider

Owner

tameraydin commented May 12, 2016

$ngToastProvider -> ngToastProvider

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment