What is uibmodal in angular?

You are currently viewing What is uibmodal in angular?

uibmodal is the service to create the modal window. uibmdal is the UI Bootstrap components written in AngularJS by the Angular UI team. This service has only one method is called:  open(options). We can say uibmodal is the angular js module to enable us to use the Bootstrap in angular JS. It is providing directives for all plugin of bootstrap with some extra like, datepicker, timepicker, etc.

Getting started with Bootstrap in AngularJS

Check out on here: Bootstrap in AngularJS

Files to download

Build files is available for all directives with different flavours. All the options of bootstrap are described and can be downloaded from here.

Installation of uibmodal

angular.module('myModule', ['ui.bootstrap']);


(function() {
'use strict';

        .factory('sourceListModal', sourceListModal);

    const modalTemplate = `
        <div class="source-list-modal">
            <div class="modal-header">
                <h3 class="modal-title">
                    My Modal Title
                <div class="controls">
                    <button class="btn btn-primary" type="button" ng-click="save()">Save</button>
            <div class="modal-body">

    /* @ngInject */
    function sourceListModal($uibModal, someWebServices) {
        var service = {
            open: open

        return service;


        function open(syncData) {
            const modalInstance = $uibModal.open({
                animation: true,
                template: modalTemplate,
                controller: ModalInstanceController,
                resolve: {
                    syncData: () => syncData,
                    asyncData: () => someWebServices.getAsyncData()
            return modalInstance;

    /* @ngInject */
    function ModalInstanceController($scope, $uibModalInstance, syncData, asyncData) {

        $scope.asyncData = asyncData;
        $scope.moreData = syncData;

        $scope.save = function() {

        $scope.cancel = function() {



Visit the angular tutorial list. And make strong your angular concept. click here. wuschools.com is always written about the Agular concept for the angular lover. Ang writes about how angular makes your life easy if you are a web site developer.

Leave a Reply