2017-04-27 72 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>。檢查一下。

相關問題