2017-03-14 33 views
0

我創造與AngularJS一個Web應用程序,啓動在頁面加載AngularJS引導模式

我要推出從AngularJS頁面加載的引導模式,

這裏是我的模式:

<div class="modal hide fade" id="myModal"> 
    <div class="modal-header"> 
     <a class="close" data-dismiss="modal">×</a> 
     <h3>Modal header</h3> 
    </div> 
    <div class="modal-body"> 
     <p>One fine body…</p> 
    </div> 
    <div class="modal-footer"> 
     <a href="#" class="btn">Close</a> 
     <a href="#" class="btn btn-primary">Save changes</a> 
    </div> 
</div> 

這裏是我的控制器

<script> 
    var app = angular.module('myapp', []); 
    app.controller('myctrl', function ($scope, $window, $http) { 
     $('#myModal').modal('show'); 
    }) 
</script> 

什麼是網頁LOA發射模式的正確方法d?

+0

你試過你的代碼?你有沒有錯誤? – Weedoze

+0

沒有,但我的頁面已經淡出了一下@Weedoze –

+0

你應該使用[角UI的自舉(https://angular-ui.github.io/bootstrap/)有一個良好的解決方案 – gianlucatursi

回答

3

這是因爲該模式的結構是錯誤的,hide類是防止它顯示。

<div class="modal fade" id="myModal"> 
     <div class="modal-dialog" role="document"> 
      <div class="modal-content"> 
      .. 
      </div> 
      <!-- /.modal-content --> 
     </div> 
    </div> 

Demo on Codeply

相關問題