2016-06-16 4 views
1

レンダリング済みのダイアログボックスを使用しようとしていますが、何らかのエラーが考えられます。私は角材プレビューダイアログボックス問題

<div style="visibility: hidden"> 
     <div class="md-dialog-container" id="myDialog"> 
      <md-dialog layout-padding="" aria-label="myDialog"> 
       <h2>Pre-Rendered Dialog</h2> 
       <p> 
        This is a pre-rendered dialog, which means that <code>$mdDialog</code> doesn't compile its 
        template on each opening. 
        <br><br> 
        The Dialog Element is a static element in the DOM, which is just visually hidden.<br> 
        Once the dialog opens, we just fetch the element from the DOM into our dialog and upon close 
        we restore the element back into its old DOM position. 
       </p> 
      </md-dialog> 
     </div> 
    </div> 

としてHTMLを使用していた

また私のJavaScriptは、任意のヘルプ次のコード

$scope.showPrerenderedDialog = function (ev) { 
     $mdDialog.show({ 
      controller: DialogController, 
      contentElement: '#myDialog', 
      parent: angular.element(document.body), 
      targetEvent: ev, 
      clickOutsideToClose: true 
     }); 
    }; 

    function DialogController($scope, $mdDialog) { 
     $scope.hide = function() { 
      $mdDialog.hide(); 
     }; 

     $scope.cancel = function() { 
      $mdDialog.cancel(); 
     }; 

     $scope.answer = function (answer) { 
      $mdDialog.hide(answer); 
     }; 
    } 

が含まれていますか?

+0

コンソールですべてのエラーを取得していますか?何が起きているのか、ダイアログが開いていないのですか? – gaurav5430

+0

同じ問題があるIm。これを理解しましたか? – Aaron

+1

はい私はそれを考え出しました。角度バージョンの最新バージョン、つまりRCバージョンを追加する必要があります。それは後に正常に動作します –

答えて

0

Vishalが指摘しているように、角度素材の最新バージョンが必要です。私の場合、1.1.0-RC2では十分ではありませんでした。私は1.1.0-RC5に切り替え、すべてが期待通りに機能しました。最新リリースは、ここ

を見つけることができます:https://developers.google.com/speed/libraries/#angular-material

関連する問題