What Is. $Uibmodal in Angularjs?

I got this code

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

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

1

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.
                 });
0

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:

Project details is here:

Happy reading :).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest