Tuesday 1 December 2015

Showing a Popup Window using Modals in Angularjs

A dialogue box is called modal when it restricts the other functionality of the page until the dialogue box has been closed.
Here is the code for opening a simple modal popup using ‘modals’ in angularjs.
first create a simple HTML template and call a function on a button click in which the modal will get open:
 
  1. <html>
  2. <div class="maiWidth">
  3. <h2 class=“adminhead”>Admin List</h2>
  4. <div class="col-sm-3 columns">
  5. <button type="" class="btn grn-btn" ng-click=Confirm()>Confirm Admin
  6. </button>
  7. </div>
  8. </div>
  9. </html>
In the above code I have called a confirm function on a button click.
Then add this script for the modal template like this without html tag.
AngularJS
Being an effective forum, here you can also post & look for various programming queries along with their solutions including c, java, php, Android Developer Forum etc.

No comments:

Post a Comment