Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is .$uibModal in AngularJS?

Tags:

angularjs

I got this code

$uibModal.open({
templateurl:'',
controller:'',
backdrop:'',
size:''
resolve: ''

Can someone explain me its usage and what are its parameters usage?

like image 535
Raouf Manzoor Avatar asked Aug 18 '16 08:08

Raouf Manzoor


2 Answers

$uibModal is a service to create modal windows. It has an open method, that will return a modal instance.

var modalInstance = $uibModal.open({
                     templateUrl: 'view/sample.html',
                     controller: 'testController',// a controller for modal instance
                     controllerUrl: 'controller/test-controller', // can specify controller url path
                     controllerAs: 'ctrl', //  controller as syntax
                     windowClass: 'clsPopup', //  can specify the CSS class
                     keyboard: false, // ESC key close enable/disable
                     resolve: {
                         actualData: function () {
                             return self.sampleData;
                         }
                     } // data passed to the controller
                 }).result.then(function (data) {
                     //do logic
                 }, function () {
                     // action on popup dismissal.
                 });
like image 198
ciril sebastian Avatar answered Nov 16 '22 02:11

ciril sebastian


It is a service for opening modals in AngularJs. It is a part of "UI Bootstrap - AngularJS directives specific to Bootstrap" project.

Documentation is here:

  • https://github.com/angular-ui/bootstrap/tree/master/src/modal/docs

Project details is here:

  • https://github.com/angular-ui/bootstrap

Happy reading :).

like image 45
Witold Kaczurba Avatar answered Nov 16 '22 01:11

Witold Kaczurba