1

I have this configuration in my angularJS application

(function() {
'use strict';

angular
    .module('myAppl.dashboard')
    .config(configure);

configure.$inject = ['$stateProvider']; 

function configure($stateProvider) {

    $stateProvider
        .state(getDashboardState());

    ////////////

    function getDashboardState() {
        var state = {
    ...

Now I will use ngToast with this config:

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

I thought that I can inject ngToast like this:

configure.$inject = ['$stateProvider', 'ngToast']; 

function configure($stateProvider, ngToast) {

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

but this lead in a Uncaught Error: [$injector:modulerr] error

Ramkrishna Sharma
  • 6,961
  • 3
  • 42
  • 51
quma
  • 5,233
  • 26
  • 80
  • 146

0 Answers0