ng-include 包含一個頁面的顯示問題


第一種
-------------------------------------------------------------------------------------------------------------------------------------
A.html

<!--既往史,要以彈框形式顯示-->
<div class=" pull-right">
  <button class="btn btn-primary" ng-click="openHistory()">既往史</button>
</div>
<!--既往史管理-->
<div ng-controller="PreExamHistoryController" id="preHistoryDiv" class="past-history-index"
      ng-include src="'../templates/pre-exam-history-template.html'">
</div>

A.html對應的js

//既往史按鈕點擊彈出彈框,
$scope.openHistory=function({
    angular.element('#preHistoryDiv').scope().openHis();
};

PreExamHistoryController對應的js

$scope.openHis=function(){
  $scope.previousHistoryModalFlag=true;
};

Pre-exam-history-temolate.html

<div hr-draggable modal="previousHistoryModalFlag" close="closeHistoryModal()" options="previousHistoryModal">
</div>

Pre-exam-history-temolate.html沒有對應的controller所有的業務處理都在PreExamHistoryController中完成

-------------------------------------------------------------------------------------------------------------------------------------

第二種
-------------------------------------------------------------------------------------------------------------------------------------
A.html

<div ng-show="queueInfo" class="queueInfo">
  <div ng-include src="'../statisticquery/emergency-queue.html'" ></div> </div>

A.html對應的js

$scope.queueInfo = true;

emergency-queue.html

<div class="right-side border-line" ng-controller="queueMonitoringController" ng-cloak>
</div>

-------------------------------------------------------------------------------------------------------------------------------------


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM