2

I am using http://angular-ui.github.io/bootstrap/ modal.

Now i want to open Modal whenever page loads

  <script>
     $(document).ready(function () {                
                 open('lg');         
      });
  </script>
user2614879
  • 151
  • 1
  • 2
  • 9

2 Answers2

2

Angular http://angular-ui.github.io/bootstrap/ has a directive and the $modal service and both of those can be used to open modal windows.

you then need to use:

$modal.dialog({}).open('modalContent.html');  

there is a similar question in here: Invoking modal window in AngularJS Bootstrap UI using JavaScript

Community
  • 1
  • 1
Liad Livnat
  • 7,435
  • 16
  • 60
  • 98
1

Module API has a run method. In your code for you app you add code to open the dialog in the run callback

angular.module('myAppModule').run(function($modal) {
  $modal.open(options);   //the option data. See documentation.
});
Chandermani
  • 42,589
  • 12
  • 85
  • 88
  • Not working... angular.module('transport').run(function($modal) { $modal.open({templateUrl: 'deleteCheked.html', controller: ModalInstanceCtrl, size : size, resolve: { items: function () { return $scope.items;}}); //the option data. See documentation. }); – user2614879 Jul 16 '14 at 12:49
  • That modal does not exsits. – user2614879 Jul 17 '14 at 07:19
  • error is gone (was mismatch of myAppModule name). Now problem is that nothing happens when angular.module is runned (event alert does not shoot) – user2614879 Jul 17 '14 at 07:21