As I work on designing a web application using AngularJS,
I aim to implement the launching of a bootstrap modal upon page load through AngularJS.
Here is the structure of my modal:
<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>
Additionally, here lies an excerpt from my controller:
<script>
var app = angular.module('myapp', []);
app.controller('myctrl', function ($scope, $window, $http) {
$('#myModal').modal('show');
})
</script>
Could you suggest a more appropriate method for triggering the modal on page load?