参数' formErrorLogController'不是一个功能,未定义

时间:2017-04-27 12:57:56

标签: angularjs bootstrap-modal

我正在尝试使用modalInstance。 我有以下内容:

$scope.openClaimLogError = function (deni_arr) {
    $scope.data = {
      deni_arr : deni_arr
    };

    modalInstance = $modal.open({
        templateUrl: 'app/shared/templates/formErrorLog.html',
        controller: 'formErrorLogController',
        resolve: {
            data: function () {
                return $scope.data.deni_arr;
            }
        }
    });
}`

This code is in Controller1.js

And in Controller2.js I have the following: 

`'use strict';
    app.controller('formErrorLogController',
    function ($scope, $cookies, claimsService, $modal, $filter, data) {}`

我到底想要做的是将数据发送到第二个控制器,以便打印出来。

为什么会出现这样的错误:Error: [ng:areq] Argument 'formErrorLogController' is not a function, got undefined

1 个答案:

答案 0 :(得分:0)

由于错误显示控制器丢失,您可能错过了在index.html中包含一个控制器文件,就像使用<script src="..."></script>一样。检查一下。