2017-04-27 71 views
0

我想用modalInstance。 我有以下几点:参数'formErrorLogController'不是一个函数,得到undefined

$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

+0

你可能没有包含脚本参考 – Aravind

+0

@Aravind,我应该在哪里做? 多一点解释:我有一个form_page.html和formErrorLog.html.html(如上),在form_page.html的控制器(controller1.js)我有一个未完成字段的数组,我想传递给formErrorLog.html的控制器(controller2.js)将出现在模式上。 –

+0

@FineasSilaghi in index.html? – tanmay

回答

0

由于错误说,它缺少控制器,你可能已经错过了包括index.html控制器的一个文件中使用<script src="..."></script>。检查一下。

相关问题