AngularJS - 将ngToast配置添加到* .routes.js

时间:2016-11-03 06:57:06

标签: angularjs ngtoast

我在angularJS应用程序中有这个配置

(function() {
'use strict';

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

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

function configure($stateProvider) {

    $stateProvider
        .state(getDashboardState());

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

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

现在我将使用此配置的ngToast:

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

我以为我可以像这样注入ngToast:

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

function configure($stateProvider, ngToast) {

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

但这导致未捕获错误:[$ injector:modulerr] 错误

0 个答案:

没有答案