2016-08-01 3 views
0

私はHTMLで次のディレクティブを持っている:AngularJS値ではないディレクティブで可視およびテンプレート - HTML

<as-excel-download institutionId="vm.reportInstitution.id"></as-excel-download> 

ディレクティブは次のようになります。

(function() { 
'use strict'; 

angular 
    .module('aposoft.common') 
    .directive('asExcelDownload', asExcelDownload); 

function asExcelDownload() { 
    var directive = { 
     restrict: 'E', 
     scope: {     
      institutionId: '=' 
     }, 
     templateUrl: 'app/common/exceldownload/asExcelDownload.html' 
    }; 
    return directive; 

    //////////// 
} 
})(); 

とディレクティブのテンプレートは次のようになります。

<a href="/api/schedulerecordexcel/monthreport/{{institutionId}}"> 
    <img src="./Excel.PNG" alt="icon" /> 
</a> 

実際に私は{{institutionId}}がemtyという指示テンプレートhtm l。 institutionIDを上記のファイル(コントローラのスコープ)とディレクティブテンプレートhtmlのアクセス機関IDのすべてがすべてうまく動作するよりも、すべてに変更した場合。 誰も私がここで間違っていることを知っていますか?

+0

あなたは 'console'で何も見えていますか? –

+0

いいえ、firefox firebugコンソールにエラーはありません。 – quma

+0

'institutionId'の値が何であるかを知るために、' link.'の中で 'console.log(institutionId)'を使用できますか?正確なパス値 'vm.reportInstitution.id'をチェックすることができますか? –

答えて

1

は、私はあなたが属性として間違った名前を使用していると思うので、基本的にこの部分:

<as-excel-download institutionId="vm.reportInstitution.id"></as-excel-download> 

は次のようになります。

<as-excel-download institution-id="vm.reportInstitution.id"></as-excel-download> 
関連する問題