Angular-uiのバージョンはわかりませんが、モーダルウィンドウのドキュメントは混乱を招きます。モーダルウィンドウを表示する一部としてngIncludeディレクティブを実際に使用することはできますが、以下に示すように必須ではありません。以下の場合、モーダルhtmlとスクリプトは別々のファイルにあり、modal.open()を使用してそれらを参照および表示します。何らかの理由で、更新可能なモデルは、$ scope ..のオブジェクトプロパティとして渡された場合にのみ有効にできました(コードの「vm。」を参照)。
ModalView.htmlスニペット
<!-- html elements reference the ModalViewCtrl decorated $scope -->
<input ng-model='vm.email' type='email' placeholder='Email address' autofocus />
<input ng-model="vm.password" type="password" class="form-control" placeholder="Password" />
<label class="checkbox">
    <input ng-model="vm.rememberMe" type="checkbox" />
    Remember me
</label>
ModalViewCtrl.jsスニペット
 angular.module('app')
   .controller('ModalViewCtrl', function($scope, $modal, parms) {
      /* decorate the $scope and/or preset the $scope.vm object
         as needed with parms.parm1, parms.parm2, ....
      */
      $scope.ok = function () {
         $modalInstance.close($scope.vm);
      };
      $scope.cancel = function () {
         $modalInstance.dismiss();
      };     
   });
SourcePageCtrl.jsスニペット
 angular.module('app')
   .controller('SourcePageCtrl', function($scope, $modal, ...) {
      $scope.open = function() {
         var modalInstance = $modal.open({
            templateUrl: 'path_literal_to_ModalView.html'
            ,controller: 'ModalViewCtrl'
            ,resolve : {
                parms : function() { return {
                   parms1 : value1
                  ,parm2 : value2
                  ,...
                }}
            });
         modalInstance.result.then(
            function (vm) { 
                $scope.result = vm;
            } , function () {
                ... 
            }
         );
      });
   });
ただし、includeを使用する場合は、2つの落とし穴があります。
- 'templateUrl'は、テンプレートファイルのURLとは対照的に、ngInclude自体のIDなどのモーダル要素containsタグのIDを参照する必要があります。
- 角度は属性値を評価するため、パスのsrc属性にリテラルが提供されている場合、要素はすでに引用符で囲まれた文字列内で引用符で囲まれている必要があります。