私は次の問題を解決するために午後中ずっと試みてきました: 検索フォームを表示するディレクティブを作成しました。検索語のモデルはコントローラーで定義され、ディレクティブと完全に通信します。しかし:DOMの準備ができた後にロードされるAngularテンプレート内にディレクティブを配置すると、それはディレクティブへの1つの方法であり、戻ることはありません。
<body ng-app="myApp">
<div ng-controller="NewEditCtrl">
<script type="text/ng-template" id="/tab-content.html">
<!-- First position for the directive: The way back from the directive to here does not work -->
<!-- Uncomment to test and show the console output ! -->
<!-- <span mediasearch term="searchterm" enter="sendForm(e)" action="refreshAvailable()"></span> -->
</script>
<!-- Second position: Here the way back from the directive works perfectly -->
<span mediasearch term="searchterm" enter="sendForm(e)" action="refreshAvailable()"></span>
<div id="tab-content" ng-include src="tabcontent"></div>
</div>
この例を実際のフィドルに入れました: http://jsfiddle.net/RCaCM/2/コメントをご覧ください。
スコープの問題だと思いますが、$apply や $compile ではポイントに達しません。
よろしくお願いします。XL