2017-04-27 20 views
0

modalInstanceを使用しようとしています。 私は以下の持っている:まさに私がやろうとしている何引数 'formErrorLogController'は関数ではなく、定義されていません

$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) {}` 

は、私はそれを印刷できるように、第2のコントローラにデータを送信することです。

は、なぜ私はこのようなエラーが出るん:エラーは、それがコントローラ欠けがあると言うのでError: [ng:areq] Argument 'formErrorLogController' is not a function, got undefined

+0

スクリプトリファレンス – Aravind

+0

@Aravindは含まれていない可能性があります。 もう少し説明しました:form_page.htmlのコントローラ(controller1.js)にform_page.htmlとformErrorLog.html.html(上のように)があります。渡したい未完成のフィールドを持つ配列がありますformErrorLog.htmlのコントローラ(controller2.js)は、モーダルに表示されます。 –

+0

@FineasSilaghi in index.html? – tanmay

答えて

0

は、あなたは<script src="..."></script>を使用してのようにindex.html内のコントローラのいずれかのファイルが含まれるように見逃しているかもしれません。それを確認してください。

関連する問題